2

Whenever I click a certain button, the app always dies and I'm sent to:

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

For those who are familiar, you know that I didn't write this code. I don't know how to find out where my error is!

Also, the output shows this:

2011-10-27 21:03:17.690 My Program[55441:207] Unbalanced calls to begin/end appearance transitions for <UITabBarController: 0x68181f0>.
(lldb) 

I don't know where to look short of commenting out code line by line until I find the issue. Any suggestions?

Jacksonkr
  • 31,583
  • 39
  • 180
  • 284
  • 3
    that's not a bad strategy. Though a better one is to comment out *half* your code so that you can find the error in `log(N)` time. – ObscureRobot Oct 28 '11 at 03:11
  • 1
    Commending out your apps main entry point (the line you've indicated) is not going to get you far. Try setting a breakpoint at the start of the button's method, and stepping through until the crash. – Kenny Winker Oct 28 '11 at 03:17
  • @Kenny I was planning on commenting out the code related to the button that I push and starting there, not the `main` code (I realize now that I didn't make that clear). – Jacksonkr Oct 28 '11 at 03:26
  • It's highly likely that you are using XCode 4.2. By the way, can you please paste your code snippet? Are you using that button to present a viewController? – Aniruddh Oct 28 '11 at 05:18

2 Answers2

1

You are likely running the fact that Xcode 4.2 does not show stack traces most of the time. Check this SO post.

Xcode 4.2 debug doesn't symbolicate stack call

Community
  • 1
  • 1
logancautrell
  • 8,762
  • 3
  • 39
  • 50
  • I fixed the original issue, then got this "error" again for something else a while after. I tried the solution you sent over, but i'm still sent to `main` - I'll keep looking into it. +1 for your resource. – Jacksonkr Oct 28 '11 at 13:34
0

on the button click a new UIView is pushed into the Window. That view's .xib had linkage that was bad (linked to an IBOutlet that didn't exist in code anymore because it was renamed).

I set up the correct linkage in Interface Builder and I no longer got the error. I wish xcode would at least tell you there's a problem with one of your .xib files.

PART 2

Shortly after that fix I was getting this error again. After searching the web for a bit, I found that it could be related to a memory leak so I ran the Project->Analyze tool. When I fixed Xcode's suggestions, everything ran fine.

Jacksonkr
  • 31,583
  • 39
  • 180
  • 284