3

In my App I have an UIViewController, that pushed by another ViewController's navigation controller. It contains some views, buttons, scrollViews and accelerometer support. When I tapping "back" button of navigationController, app crashes without any log message, except this one: "warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found). (gdb)" debugger links me to this line in main.m:

int retVal = UIApplicationMain(argc, argv, nil, nil);

with "EXEC_BAD_ACCESS" what does this mean?

EDIT: all of you are right. problem was in accelerometer. I setted delegate ([UIAccelerometer sharedAccelerometer].delegate = self;) and didn't remove it. that's why there was no line in my code for debugger to link to. I just added this:

 - (void)viewWillDisappear:(BOOL)animated {
        [UIAccelerometer sharedAccelerometer].delegate = nil;
    }

and problem gone. So, If you are using any device functions, be careful with delegates.

SentineL
  • 4,682
  • 5
  • 19
  • 38

4 Answers4

6

Did you set Zombies to enabled? That will enable you to track if you access an already released object, and that tells you which object it is.

If you are using XCode 4, you can enable zombies in Project -> Edit Scheme -> Diagnostics by checking the "Enable Zombies" checkbox.

Also make sure you have "Break on Exception" set on - in XCode 4 go to the Breakpoint View, press the Plus sign in the lower left corner, and choose "Add Exception Breakpoint ..." for all exceptions. Then XCode will break at the point where the exception occurs, and you will see more than just UIApplicationMain as the location.

TheEye
  • 9,280
  • 2
  • 42
  • 58
1

This means you have tried to read/write a block of memory you have no permission to. Maybe you're trying to use an object you haven't allocated/initialized. Check your code, debug it and inspect variables to find a solution.

Daniel Albert
  • 757
  • 5
  • 22
  • thx for responce. It usual links to line, where I used it. but this time it didnt. May be i wasn't clear anouth in my question: what could I use, so it didn't link me to any line in my code? PS sorry my poor endlish – SentineL Nov 10 '11 at 09:26
  • Developing in objective-c and Xcode is a little bit frustrating: when you have this kind of error you don't know the stacktrace and where is the error. Try to debug and inspect variables. – Daniel Albert Nov 10 '11 at 09:29
  • Maybe you setted an attribute and you didn't retain it. I refer to: http://stackoverflow.com/questions/3375063/what-is-the-use-of-property-nonatomic-retain-statement-in-the-application – Daniel Albert Nov 10 '11 at 09:34
1

I guess you had a memory warning and you app deallocated some datas tha are not there anymore when you go back.

Put some breakpoint into didReceiveMemoryWarning, dealloc, viewDidUnload and viewDidLoad to see what happens in your previous controller.

Oliver
  • 23,072
  • 33
  • 138
  • 230
1

EXC_ BAD_ ACCESS is an exception (EXCeption_ BAD_ ACCESS).

If you set a breakpoint on objc_exception_throw (sign + on the lower left corner of debug tab), you'll get those.

You might want to look at NSZombieEnabled (http://www.cocoadev.com/index.pl?NSZombieEnabled), as you're probably trying to access a dealloc'd object.

Oliver
  • 23,072
  • 33
  • 138
  • 230