Re: nil in NSArray
Re: nil in NSArray
- Subject: Re: nil in NSArray
- From: Alex Horovitz <email@hidden>
- Date: Mon, 15 Dec 2008 10:08:03 -0500
On Dec 13, 2008, at 7:40 PM, Mike Schrag wrote: OK -- So what's the official reason why you aren't allowed to put a nil into an Objective-C NSArray? It seems like a pretty silly restriction to me ...
Mike - I asked Steve Naroff for you...
On Dec 15, 2008, at 10:00 AM, steve naroff wrote: On Dec 13, 2008, at 7:52 PM, Alex Horovitz wrote:
Here's Ali Ozer's perspective...
If you allow nils in collections, then you can't tell from calls such as objectForKey: or objectEqualToObject: whether the nil return indicates failure or a hit on nil. So you have to have another sentinel, which is what the lower level APIs (NSHashTable, NSMapTable) do, with the added complexity in API of course.
Sounds like the kit folks chose to keep the API simpler (at the cost of not allowing 'nil'). Not super compelling, but a design made a long time ago...
snaroff
-A
Alex ~~~~~~~~~~~~~~~~~~~~~~ Alex Horovitz Chief Technology Officer The Brookeside Group, Inc.
524 Main Street The Brookeside Group, Inc. - Loyalty MattersTM.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden