Re: NSNull and @""
Re: NSNull and @""
- Subject: Re: NSNull and @""
- From: "Michael Ash" <email@hidden>
- Date: Sat, 11 Oct 2008 10:21:03 -0400
On Sat, Oct 11, 2008 at 5:51 AM, Andrew Farmer <email@hidden> wrote:
> On 10 Oct 08, at 19:28, Ian Joyner wrote:
>>
>> So it's really a workaround for this situation. I think therefore there
>> are several constructs to represent the same concept of "lack of presence" –
>> nil, Nil, Null, and NSNull.
>
> Fewer than you think, actually. nil, Nil, and NULL are all internally
> synonymous: the only difference is that nil and Nil have traditional
> meanings in ObjC. (nil is (id) NULL, and Nil is (Class) NULL). NSNull is the
> only odd case out - it's used in situations where a concrete object is
> needed, such as in collections.
And just for the sake of accuracy, while this is conceptually correct,
my installation of gcc expands all of them to ((void *)0). So at the
low level they are interchangeable, but you should of course only use
them in cases where they make semantic sense.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden