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

Re: Question about floatValue on nil object


  • Subject: Re: Question about floatValue on nil object
  • From: Sherm Pendley <email@hidden>
  • Date: Tue, 13 Sep 2005 05:05:12 -0400

On Sep 13, 2005, at 4:42 AM, Michaël Parrot wrote:

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.

There is no problem - it's documented behavior. From "Object Messaging", the last paragraph of the first section, found at:


<http://tinyurl.com/aj9kc>
<http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ LanguageOverview/chapter_3_section_3.html>


"A message to nil also is valid, as long as the message returns an object; if it does, a message sent to nil returns nil. If the message sent to nil returns anything other than an object, the return value is undefined."

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

_______________________________________________
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


References: 
 >Question about floatValue on nil object (From: Michaël Parrot <email@hidden>)

  • Prev by Date: Re: Question about floatValue on nil object
  • Next by Date: Compute value in IB using bindings
  • Previous by thread: Re: Question about floatValue on nil object
  • Next by thread: Compute value in IB using bindings
  • Index(es):
    • Date
    • Thread