Re: Question about floatValue on nil object
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