Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What cause EXC_BAD_ACCESS?



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >What cause EXC_BAD_ACCESS? (From: Norio Ota <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.