1791 Views 4 Replies Latest reply: Jan 28, 2009 11:37 AM by YuriNiyazov
The "Add" button is initially disabled. The Add button is enabled/disabled depending on whether the NSTextField is empty or not. This is done by implementing the
- (void)controlTextDidChange:(NSNotification *)aNotification
It might be easier to use key/value binding for this type of problem. It is like Core Data without the database.
(replaced brackets with braces because the posting software turns that into strikethrough)
Use two lines of
with your code in between
to fix that.
however, it is apparent that the delegate methods of the textField are not called when the contents are edited programmatically.
I would have to get knee deep in code to verify that. But if you are doing it programatically, why not just call the delegate yourself?
Anyway - is this the correct and accepted way of doing this in Cocoa, or am I missing something more obvious and more elegant?
I have one program where I have to do things like controlTextDidChange. It is a royal hassle. When I get time I plan to change it all to key/value binding. It is much easier to use.