Re: NSArray losing its data
Re: NSArray losing its data
- Subject: Re: NSArray losing its data
- From: "Jean-Olivier Lanctôt-D." <email@hidden>
- Date: Sun, 17 Nov 2002 13:43:19 -0500
1) initWithCapacity is a NSMutableArray -only instance method.
2) If you claim that [[NSMutableArray alloc]
initWithCapacity:0] returns an autoreleased instance, then explain me
the diff. between
[[NSMutableArray alloc] initWithCapacity:i]
and
[NSMutableArray arrayWithCapacity:i]
Why do you initWithCapacity:0? You didn't answer that question.
From the doc
- (id)initWithCapacity:(unsigned)numItems
Initializes a newly allocated array, giving it enough memory to hold
numItems objects. Mutable arrays expand as needed, so numItems simply
establishes the object's initial capacity. Returns self.
If you ask the array to init with 0 numItems, then you can't add
NOTHING to that array.
Right?
-- Jean-Olivier
_______________________________________________
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.