Bindings validation messages never reach an NSArrayController subclass
Bindings validation messages never reach an NSArrayController subclass
- Subject: Bindings validation messages never reach an NSArrayController subclass
- From: "Jeremy Higgs" <email@hidden>
- Date: Sun, 16 Apr 2006 17:46:40 +1000
Hi guys,
I'm trying to implement validation for some fields in a tableview
backed by bindings, but I'm having problems... What I'm attempting is
to check whether there's an existing item in the array with the same
name/key, and if so, throw back an error (so there aren't duplicates
and the existing object isn't clobbered).
I've implemented both of the following methods in a subclass of
NSArrayController:
- (BOOL)validateValue:(id *)ioValue forKeyPath:(NSString *)inKeyPath
error:(NSError **)outError;
- (BOOL)validateValue:(id *)ioValue forKey:(NSString *)key
error:(NSError **)outError;
... as well as changing the array controller in the NIB to the custom
subclass. I have enabled "Validates Immediately" for the table column
bindings settings, as well on the controller. (I suppose only one of
them was necessary, and probably have different effects, but neither
seems to work!)
I've read over the bindings docs (and the "Bindings Message Flow"
diagrams), and haven't uncovered any problems with how I'm approaching
this.
Can anyone suggest what I'm doing wrong, or how to implement
validation at the controller level?
Thanks!
Jeremy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden