• 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: "M. Uli Kusterer" <email@hidden>
  • Date: Wed, 31 Mar 2004 18:51:33 +0200

At 12:14 Uhr -0700 30.03.2004, April Gendill wrote:
Make sure that if the array is global it is declared some where in the header or above the implementation line in the class file.
NSMutableArray * serverWindows;

Just a suggestion: Do

NSMutableArray* serverWindows = nil;

then in your init method:

serverWindows = [[NSMutableArray alloc]init];

Wrap the actual code that alloc/inits the array in an

if( serverWindows == nil )
{
...
}

That way, when your code is called multiple times, it will just use the same global array (which is probably the point of using a global array anyway). Or if it isn't in your case, feel free to add an

if( serverWindows != nil )
{
[serverWindows release];
serverWindows = nil;
}

before the array creation step (you could then leave the serverWindows == nil check, because it would either have been nil, or be caught by the release above, which makes sure the old array is released (i.e. you won't leak) and you still get a new, working array.

--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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: April Gendill <email@hidden>)

  • Prev by Date: Re: classic floating window behavior?
  • Next by Date: Re: Incompatible types error using vImage
  • 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