Post

Replies

Boosts

Views

Activity

Cocoa binding to NSButton messes with enabled state
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.
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
575
Feb ’24
Failed to find localization for values: All, of the following are true
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
0
0
352
Sep ’24