• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why does this keep sending EXC_BAD_ACCESS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Why does this keep sending EXC_BAD_ACCESS (From: Angel Caban <email@hidden>)
 >Re: Why does this keep sending EXC_BAD_ACCESS (From: j o a r <email@hidden>)
 >Re: Why does this keep sending EXC_BAD_ACCESS (From: Angel Caban <email@hidden>)

  • Prev by Date: Re: Why does this keep sending EXC_BAD_ACCESS
  • Next by Date: Re: classic floating window behavior?
  • Previous by thread: Re: Why does this keep sending EXC_BAD_ACCESS
  • Next by thread: Re: Why does this keep sending EXC_BAD_ACCESS
  • Index(es):
    • Date
    • Thread