When an NSButton's value and hidden state are bound to properties, changing either property enables the button.
See example code:
@interface MyClass ()
@property (nonatomic) BOOL buttonHidden;
@property (nonatomic) BOOL buttonState;
@end
@implementation MyClass {
__weak IBOutlet NSButton *button; // The button is in a view designed in IB
}
- (void)awakeFromNib {
[super awakeFromNib];
[button bind:NSHiddenBinding toObject:self withKeyPath:@"buttonHidden" options:nil];
[button bind:NSValueBinding toObject:self withKeyPath:@"buttonState" options:nil];
button.enabled = NO;
self.buttonHidden = NO; // This enables the button. If this line isn't executed, the buttons stays disabled.
}
@end
Note that the issue occurs only of both properties are bound.
I wonder if this is by design or a bug.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
After each macOS update come new annoying log messages.
So after updating to Sonoma and Xcode 16, I see the following logged in the Xcode console whenever my app shows an NSPredicateEditor.
Failed to find localization for values: All, of the following are true
I tried setting the "localize" attribute to "never" in the attributes inspector of the corresponding menu/text fields from interface builder, to no avail.
Any suggestions ?
Topic:
UI Frameworks
SubTopic:
AppKit