Re: Why does this keep sending EXC_BAD_ACCESS
Re: Why does this keep sending EXC_BAD_ACCESS
- Subject: Re: Why does this keep sending EXC_BAD_ACCESS
- From: p3consulting <email@hidden>
- Date: Tue, 30 Mar 2004 20:45:19 +0200
Le 30-mars-04, ` 19:36, Angel Caban a icrit :
By assigning an autoreleased object do you mean something like this:
- (id)init
{
self = [super init];
if(self) {
serverWindows = [[NSMutableArray arrayWithCapacity:5] autorelease];
channelWindows = [[NSMutableArray arrayWithCapacity:15] autorelease];
[serverWindows retain];
[channelWindows retain];
}
return self;
}
[NSMutableArray arrayWithCapacity:] returns an autoreleased object
so what you are doing is "autorelease the object twice and retain it
once",
Just do:
serverWindows = [[NSMutableArray arrayWithCapacity:5] retain];
channelWindows = [[NSMutableArray arrayWithCapacity:15] retain];
Pascal Pochet
email@hidden
_______________________________________________
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.