Search code examples
xcodecocoaxcode4

OS X program won't compile EXC_BAD_ACCESS


I'm trying to learn XCode and Mac programming. I'm trying a program from a book on XCode 4, and I'm using 4.2.1. I've been told that the error isn't the tagged line of code below. How/where can I de-bug this? A search didn't turn up anything I understood.

In main.m - "Thread1 Program received signal 'EXC_BAD_ACCESS'.

int main(int argc, char *argv[])
{
    return NSApplicationMain(argc,(const_char **)argv); //error here   
}

I don't find a Stack Navigator in View|Navigators.

enter image description here

Maybe this is what you're looking for?

enter image description here

I deleted the whole project and started over. Now I get a SIGABRT on the same line. Searching on that hasn't led to any resolution.


Solution

  • Zombie objects are great for debugging bad access.

    In Xcode 4.1 and above, there's also checkbox on the "Diagnostics" tab of the "Run" stage to "Enable Zombie Objects". - from How to enable NSZombie in Xcode?