Re: Disposing NSArray
Re: Disposing NSArray
- Subject: Re: Disposing NSArray
- From: Mike Shields <email@hidden>
- Date: Thu, 31 May 2001 21:49:49 -0600
array1 is already autoreleased by arrayWithObjects? I don't know for
sure that autoreleasing an autoreleased object causes a signal, but it
would seem odd. Or are you getting an error somewhere else?
One thing to note - convention in Cocoa says that in a class NSWhatever
that a method of the form
+ (NSWhatever*) whateverPlusSomePossibleOtherStuff
will return an autoreleased NSWhatever.
Mike
On Thursday, May 31, 2001, at 05:03 PM, Youngjin Kim wrote:
What's the differerence between two?
Both array1 and array2 are locally instantiated in a method.
-(void) doSomething {
NSArray* array1;
NSArray* array2;
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.
Youngjin
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev