RE: pointer value into floating point value???HELP???
RE: pointer value into floating point value???HELP???
- Subject: RE: pointer value into floating point value???HELP???
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Thu, 28 Aug 2003 11:10:51 -0400
>
On Thursday, August 28, 2003, at 02:54 pm, Jonathan E. Jackel wrote:
>
>
> On the other hand, if we have the slightest doubt about whether there
>
> is
>
> such an object in the dictionary we should do something like this:
>
>
>
> timerValue = [dictws1 objectForKey: @"R"];
>
> ws1R = timerValue ? [timerValue intValue] : 0;
>
>
No need for that; messages sent to nil will return zero anyway.
>
>
Kind regards,
>
>
Alastair
"The Objective C Programming Language" says:
"A message to nil also is valid, as long as the message returns an object;
if it does, a message sent to nil will return nil. If the message sent to
nil returns anything other than an object, the return value is undefined."
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/3objc_l
anguage_overview/chapter_3_section_3.html
So you have no idea what you are getting if you ask nil for an integer.
Jonathan.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.