Currently I have a BOOL in runtime attributes for my view controller that I use to see if my view controller should add a button to the navigation bar programmatically. I was told that to access the attribute in the code, you add a property with the same name like this:
@interface MyViewController
@property (nonatomic, assign) BOOL showButton;
@end
@implementation
@synthesize showButton = _showButton;
-(void)viewDidLoad {
[super viewDidLoad];
if (_showButton) {
//show button
}
}
@end
And this does work in iOS 8 and 9, but for some reason in the simulator, iOS 7 does not read the Boolean and it's always set to false.
I feel like this is a serious enough problem that someone should have an answer but Google or the search results on SO didn't seem to have results for this.
I really appreciate the help!
UPDATE: I set the value in the Storyboard.