Re: Disposing NSArray
Re: Disposing NSArray
- Subject: Re: Disposing NSArray
- From: mmalcolm crawford <email@hidden>
- Date: Fri, 1 Jun 2001 07:01:02 +0100
On Friday, June 1, 2001, at 12:03 am, Youngjin Kim wrote:
What's the differerence between two?
array1 = [[NSArray arrayWithObjects:s1,s2,s3,s4,nil] autorelease];
array2 = [[[NSArray alloc] initWithObjects:s1,s2,s3,s4,nil]
autorelease];
...
The first one will be released twice -- it's already flagged for release
when it's returned to you from the convenience constructor.
See:
http://www.stepwise.com/Articles/Technical/2001-03-11.01.html
mmalc.