Skip to content

The Popup Button Demo SEGFAULTs in “-setMenu:” #73

Description

@JanX2

This is, because BTRPopUpButton causes “-setMenu:” to be called within “-initWithFrame:” (via BTRPopupButtonCommonInit() and [self addObserver:self forKeyPath:@"menu.delegate" options:NSKeyValueObservingOptionNew context:NULL];) and it in turn calls self.menu, which is not set yet and calls through to “-setMenu:” again, resulting in an infinite loop.

Apple strongly recommends to only use ivars directly in the -init… path for this exact reason.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions