Re: null values in NSArray ???
Re: null values in NSArray ???
- Subject: Re: null values in NSArray ???
- From: "Clark S. Cox III" <email@hidden>
- Date: Fri, 17 Jan 2003 11:17:54 -0500
On Friday, Jan 17, 2003, at 10:48 US/Eastern, Bob Miller wrote:
Hello,
Can anyone tell me if it is possible to manage an NSMutableArray that
contains null values for objects at any given index ? I'd like to be
able to have an array such as this so that each location can be filled
as a 'place holder' so that if a particular object at any given index
is null, it gets ignored or possibly populated with an object id. It
seems that this would be a nice feature to have.
No, NSArray/NSMutableArray will never contain nil. The closest thing
you can do is use NSNull.
I don't want to incur the overhead of the NSNull object allocation(s)
in a large grid.
I seriously doubt that NSNull has much overhead. In fact, it appears
that NSNull is a singleton, so no matter how many times you call
[NSNull null] (or [[NSNull alloc] init]), there is only one instance of
NSNull in your application.
Can it be done by catching the null object exception ?
I doubt it.
_______________________________________________
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.