0

I keep getting the SIGBRT signal in the simulator but XCode says there are no problems with my code:

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

What could be the problem?

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
user975767
  • 51
  • 1
  • 6
  • 1
    There is no such thing as "XCode says there are no problems with my code". (See: Halting Problem) What you probably ran was the static code analyzer, which can only detect a subset of problems in the vast abyss of programming errors. In this case, you are getting a *run-time* error that the *compile-time* analyzer should not be expected to detect for you. – Shaggy Frog Dec 11 '11 at 22:52

2 Answers2

1

When an app aborts it's usually because of an exception thrown down in a library somewhere.

The best way to get a clue is to set a breakpoint in Xcode 4 for exceptions. You do this by going to the breakpoints tab, clicking the '+' down in the lower left of the window and selecting "Add exception breakpoint...". Take the default values.

This will stop the debugger when an exception is about to be thrown rather than afterwards when the app aborts.

David K. Hess
  • 16,632
  • 2
  • 49
  • 73
0

Just a shot in the dark: have you restarted your Mac trying to solve it? Since Xcode 4.2 there seems to be a bug where the Simulator hangs. Sometimes you get an arror message in the conole, but sometimes it just crashes without a meaningful sign.

brainray
  • 12,512
  • 11
  • 67
  • 116