On Mar 4, 2009, at 12:15 PM, cocoa-dev-requ...@lists.apple.com wrote:
In any case, and perhaps based purely on habit, I find it difficult to
even write:
NSStatusItem statusItem = [[[NSStatusBar systemStatusBar]
statusItemWithLength:NSVariableStatusItemLength] retain];
...in favor of:
NSStatusBar *systemBar = [NSStatusBar systemStatusBar];
if (systemBar != NULL)
{
AFAIU(nderstand):
While nil and NULL may operate interchangeably (in most cases?),
semantically, they are not the same thing.
In your code fragment above, I believe most Cocoa programmers would
expect to see:
if (systemBar != nil) ....
NULL is used more to indicate a null value c pointer.
At one time I was under the impression they were defined differently:
nil being of type id, and NULL being a void*
But in trying to research this, I run across much conflicting info and
suspect perhaps this has either changed over time, and/or depends on
whether the use is in/with C++ or not. Perhaps some of the experts on
this list can provide some clarity....
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com