setNilValueForKey: not called when Number Formatter is nil
setNilValueForKey: not called when Number Formatter is nil
- Subject: setNilValueForKey: not called when Number Formatter is nil
- From: Marc Blatt <email@hidden>
- Date: Sun, 17 Aug 2008 01:42:06 -0700
OK, so I have an table view text cell that has a number formatter
attached in Interface Builder. In order to protect against throwing an
exception, I've overridden setNilValueForKey: as follows:
- (void)setNilValueForKey:(NSString *)key
{
NSLog(@"setNilValueForKey: has been successfully called...");
if ([key isEqual:@"dollarValue"])
{
[self setDollarValue:0.00];
} else {
{
[super setNilValueForKey:key];
}
}
dollarValue is a float and is KVC/KVO compliant (with a getter and
setter) and setNilValueForKey: was overridden in the same class.
The table view text cell updates properly so long as an empty value
(aka 'nil') is not attempted (which results in a format error even
though setNilValueForKey: has been overridden). The NSLog statement
within setNilValueForKey: some unknown reason never gets called. I've
also performed a "Clean All" and still the same results.
I'm probably missing the obvious, but too tired to fight it right now.
Any thoughts would be greatly appreciated.
Thanks in advance,
Marc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden