• 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
Question about floatValue on nil object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about floatValue on nil object


  • Subject: Question about floatValue on nil object
  • From: Michaël Parrot <email@hidden>
  • Date: Tue, 13 Sep 2005 10:42:44 +0200

Hi,

I am small question. I get a NSNumer from a NSDictionary (or other, not important) and this object is equal to nil.

NSNumber *n=nil;

NSLog(@"la %f",[n floatValue]);
NSLog(@"la %d",[n intValue]);

My problem is that the second nslog show 0 value but floatValue return aleatory value.

What is the problem ?

Sure, I can check if number if equal to nil, but I am suprised that [nil floatValue] don't return nil.

Thanks a lot for comment about this.


Michaël Parrot Parrot's Softwares http://www.mparrot.net






_______________________________________________ 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
  • Follow-Ups:
    • Re: Question about floatValue on nil object
      • From: Sherm Pendley <email@hidden>
    • Re: Question about floatValue on nil object
      • From: Jack Nutting <email@hidden>
    • Re: Question about floatValue on nil object
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Re: (ALT + ENTER) in NSTextField
  • Next by Date: RE: Web VIew?
  • Previous by thread: RE: Web VIew?
  • Next by thread: Re: Question about floatValue on nil object
  • Index(es):
    • Date
    • Thread