Re: A simple doubt about array
Re: A simple doubt about array
- Subject: Re: A simple doubt about array
- From: Matt Gough <email@hidden>
- Date: Wed, 11 Jun 2008 10:56:22 +0200
On 11 Jun 2008, at 03:09, Jens Alfke wrote:
That way you won't run into the issue that NSArray objects can't
contain empty (nil) elements...
Another thing that is often overlooked by Cocoa newbies is that you
can add NSNull to NSArray objects (and other collection objects)
e.g
MyObj* anObj = somethingPossiblyNil;
[myArray addObject: anObj ? anObj : [NSNull null]];
...
MyObj* obj = [myArray objectAtIndex:1];
if (obj != [NSNull null])
{
// It really is a MyObj
}
Matt
_______________________________________________
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