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?




On 2007 Sep, 30, at 7:26, Norio Ota wrote:

I'm sorry I'm a newbie of Cocoa so that I don't know if I can show you appropriate situation, but I'll try.

An EXC_BAD_ACCESS error comes only after my app reads my custom format type of data and reads document nib file.

Maybe someone else can, but I don't see anything wrong with the code you've posted. The problem may be in some code which you did not post.


EXC_BAD_ACCESS is usually caused by sending a message to an invalid pointer, or to an object which has been released. The quick and dirty way to find a reproducible problem like this is to add many NSLog(@"1234") statements to the suspect sections of code, run, and then study the code after the last NSLog that prints. (My life has been much more fun since I made a macro to do this.)

You should also look at NSEnumerator documentation and get into the habit of using this instead of for(;;;), (unless you are modifying the collection being enumerated). NSEnumerator is more convenient and conventional to use in Cocoa.
_______________________________________________


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.