Re: What cause EXC_BAD_ACCESS?
Re: What cause EXC_BAD_ACCESS?
- Subject: Re: What cause EXC_BAD_ACCESS?
- From: Uli Kusterer <email@hidden>
- Date: Sun, 30 Sep 2007 19:29:16 +0200
Am 30.09.2007 um 16:26 schrieb Norio Ota:
An EXC_BAD_ACCESS error comes only after my app reads my custom
format type of data and reads document nib file.
Bad Access means that you're trying to access an invalid pointer,
which is usually due to either a pointer variable that wasn't
initialized correctly, or accessing a pointer that has been disposed
of already. Often this happens because someone who doesn't own a
particular object called release or autorelease on it, or because you
forgot to retain an object that you're keeping around in an instance
variable.
I wrote an article a while ago about memory management and how it
works. That may help a bit, because I spent a lot of time drawing
pictures that show memory in a nice visual fashion:
<http://www.zathras.de/howmemorymanagementworks.htm>
It starts with the bare basics you probably already know, but if you
just plow on, it should explain things more thoroughly. The article
isn't really specific to Cocoa, so if you want the whole story with
explanations specific to Cocoa, you'll want to listen through Steve
"Scotty" Scott's memory management podcast:
<http://latenightcocoa.com/node/57>
Before that, you may want to re-read Cocoa's memory management rules
on Apple's web site here:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
MemoryMgmt/Tasks/MemoryManagementRules.html>
They're short and sweet, and by first reading 'em and then hearing
'em, you're guaranteed to get everything hammered home :-)
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden