NSArray or MutableArray Null/NIL placeholder
NSArray or MutableArray Null/NIL placeholder
- Subject: NSArray or MutableArray Null/NIL placeholder
- From: Vince Ackerman <email@hidden>
- Date: Wed, 30 May 2007 07:48:11 -0700
I need to have an array of 16 (id) objects. When I create them, I
want to keep them in a specific order at a specific index in the
array. If I dispose of the object, I want the index in the array to
be empty, not back filled by the next object as suggested by the
docs. I want to be able to test the index to see if any object is
currently at that index. My question is this: Somewhere I read that
you can't insert a nil object into NSArray? What would I use as a
placeholder that would indicate an empty slot in the array? Would
null work?
Searching the docs for NSMutableArray doesn't seem to give me an
answer. All the methods seem to avoid leaving an empty index.
Also, do I need to retain/release an object when inserting/deleting
the object in an Array, or does NSArray do this automatically?
Maybe I'm misunderstanding nil/null.
Thanks in advance for any help.
Vince
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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