• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
setNilValueForKey: not called when Number Formatter is nil
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: setNilValueForKey: not called when Number Formatter is nil
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: creating files to write data to?
  • Next by Date: building a command-line tool as a bundle
  • Previous by thread: How to debug "The Debugger has exited due to signal 10 (SIGBUS)."
  • Next by thread: Re: setNilValueForKey: not called when Number Formatter is nil
  • Index(es):
    • Date
    • Thread