Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8235669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:53:11+00:00 2026-06-07T18:53:11+00:00

Every time Xcode crashes it points to this line on main.m int retVal =

  • 0

Every time Xcode crashes it points to this line on main.m

int retVal = UIApplicationMain(argc, argv, nil, @"AppController");

I know Xcode 4 debugging stinks compared to 3.x, but how do I make it point to the line where the crash happened.

Please don’t:

  1. Tell me to enable NSZombieEnabled;
  2. Tell me to add an exception breakpoint to break for all exceptions on Catch or on Throw.
  3. Tell me Xcode 4.x is better than 3.x for debugging.

All this stuff is useless or barely useless and Xcode continues to crash on the same line on main.m…

Please save me from this.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:53:12+00:00Added an answer on June 7, 2026 at 6:53 pm

    Here’s an idea: just one try/catch around your entire app, logging the stack from the exception, not the current stack (i.e. not a breakpoint + inspection):

    main.m

    int main(int argc, char *argv[])
    {
        @autoreleasepool {
            @try {
                return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
            }
            @catch (NSException *exception) {
                NSLog(@"%@",[exception callStackSymbols]);
                return 1;
            }
        }
    }
    

    My understanding is that the reason we don’t have a good method otherwise is that the crash itself does not happen until later in the runloop. I think things like uncaught exceptions, etc. just put the app in a state where it will crash somewhere in Apple’s code when the runloop iterates. This is similar to if you ever have crashes in the UI… it doesn’t always crash when you set the crappy geometry, it crashes when it tries to use it. For this reason, we need to get the stack from the exception object, not from the current-state when the crash actually occurs.

    And I’ll add this just because it got me a few times when I thought I had no info available, but I just didn’t know Xcode well enough yet (I’m sure it’s common knowledge and I was just being silly). Sometimes when I think that all I have is that dreaded top-level scope, all I needed to do was use the little slider at bottom-left (during debug sessions) to see the whole stack. This is often nearly useless, for the reasons mentioned above (it’s in another part of the runloop from the problem).

    collapsed stack
    expanded stack

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Every time my app crashes Xcode highlights the UIApicationMain() call in the main() function
I have an xcode project which crashes xcode every time it's opened. Xcode says
This is more of a general annoyance. Every time after stopping the simulator, Xcode
Every time I start build my Xcode Project, I get this in the console:
Possible Duplicate: Xcode 4.2 jumps to main.m every time after stopping simulator Whatever a
Every time I try to access my localhost/phpmyadmin it gives me this error --->
I've been having some trouble with Xcode. Every time I launch my application, it
I just upgraded to XCode 4.0.2 and ran into a strange issue. Every time
Every time when I create a new file in XCode, it makes some comment
How do I get rid of this linker warning that appears every time I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.