Re: NSArray arrayWithObjects: count: method
Re: NSArray arrayWithObjects: count: method
- Subject: Re: NSArray arrayWithObjects: count: method
- From: mmalcolm crawford <email@hidden>
- Date: Sun, 13 Apr 2003 09:54:54 -0700
On Sunday, April 13, 2003, at 01:14 AM, Dave Sopchak wrote:
It crashed right from the get-go when I set them to autorelease. If
NSArray isn't copying them, why would I set these things to
autorelease? Would not NSArray become responsible for them once I put
them in said NSArray?
<
http://www.google.com/search?hl=en&ie=ISO-8859-
1&q=cocoa+memory+management>
modules = [NSMutableArray arrayWithCapacity: 10];
for(i=0; i<10; i++)
[modules insertObject: [[MacdobModule alloc] init] atIndex: i];
I'll be trying that shortly...here I was, trying to get all the
performance benefits of an immutable array :(
modules = [NSArray arrayWithArray:modules];
mmalc
_______________________________________________
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.