Re: Disposing NSArray
Re: Disposing NSArray
- Subject: Re: Disposing NSArray
- From: email@hidden
- Date: Fri, 01 Jun 2001 05:44:58 GMT
Hi Youngjin,
>
array1 = [[NSArray arrayWithObjects:s1,s2,s3,s4,nil] autorelease];
>
array2 = [[[NSArray alloc] initWithObjects:s1,s2,s3,s4,nil]
>
autorelease];
>
I'm getting signal raised with array1. but array2 work fine.
-arrayWithObjects: is a factory method that returns an already autoreleased object while -initWithObjects: does not. No need to send -autorelease to [NSArray arrayWithObjects:s1,s2,s3,s4,nil].
HTH,
Axel