FROM : Jonathan Dann
DATE : Fri Jan 11 20:38:03 2008
> I have an NSTextField with a value bound to an NSArrayController. If a
> user edits the value, everything works OK. But when I try to do the
> same thing programmatically with
> [aTextField setValue:aString forKey:@"value"]
The @"value" is the binding name, not the key. The key is the name of
your instance variable you've bound to the NSTextField
NSString * newString // assume this exists
[aTextField setValue:newString forKey:@"personName"];
where personName is your ivar.
DATE : Fri Jan 11 20:38:03 2008
> I have an NSTextField with a value bound to an NSArrayController. If a
> user edits the value, everything works OK. But when I try to do the
> same thing programmatically with
> [aTextField setValue:aString forKey:@"value"]
The @"value" is the binding name, not the key. The key is the name of
your instance variable you've bound to the NSTextField
NSString * newString // assume this exists
[aTextField setValue:newString forKey:@"personName"];
where personName is your ivar.
| Related mails | Author | Date |
|---|---|---|
| Jonathan Dann | Jan 11, 20:38 | |
| mmalc crawford | Jan 11, 20:46 | |
| Jonathan Dann | Jan 11, 20:51 | |
| Damian Terentiev | Jan 11, 22:27 | |
| mmalc crawford | Jan 11, 22:43 |






Cocoa mail archive

