EXC_BAD_ACCESS in main.m

Suddenly I got EXC_BAD_ACCESS on this line:

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

Here is the code:

int main(int argc, char *argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, nil);
    [pool release];
    return retVal;
}

I don’t even know where to start looking?

Can anybody help?

+3
source share
3 answers

For any EXC_BAD_ACCESS errors, you usually try to send a message to the issued object. The BEST way to track these actions is used by NSZombieEnabled .

, - , "" , , , , . , , , , , , , .

, .

, , 100% , , . , , . , appdelegate:

if(getenv("NSZombieEnabled") || getenv("NSAutoreleaseFreedObjectCheckEnabled"))
  NSLog(@"NSZombieEnabled/NSAutoreleaseFreedObjectCheckEnabled enabled!");
+9

EXC_BAD_ACCESS - , , , . , , , , , , , .

, , .

+4

EXC_BAD_ACCESS often indicates that you have extended memory. You can use the Build and Analyze command in Xcode to track this. I also suggest putting breakpoints and logging in my code to isolate the error.

+1
source

All Articles