Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JanX2 opened this issue Feb 5, 2016 · 0 comments
Open

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

JanX2 opened this issue Feb 5, 2016 · 0 comments

Comments

@JanX2
Copy link

JanX2 commented Feb 5, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant