App crashes while loading with error in main.m

45,732

Solution 1

If you look in the debugger it will probably tell you what caused the error. This has happened to me before, due to insufficient memory (too many items on screen at once). Either way, look at the target debugger for what caused the error.

Solution 2

Usually when I get similar errors is because there is a broken link on the Interface Builder. Maybe you've changed the name of an IBOutlet and forgot to connect it again.

Solution 3

If you are using Storyboards, make sure you haven't hooked up duplicate referencing outlets or reference outlets that aren't there anymore in your code. In other words, if you dragged from a button on your view controller to your code and then the property or method has changed at all, you can get this error.

enter image description here

Solution 4

happened to me, looked in the debugger and found it mentioned a name I given to an action, but deleted it after I created it both viewController .h and .m so for some reason that old action created with a different name, still lingered somewhere... so I copied my code and pasted it on a new prog. Of course, it was a very small one view app so it was easy...

Solution 5

Not sure what the error message is—that would be helpful. But are you importing AppDelegate.h?

Share:
45,732
cory ginsberg
Author by

cory ginsberg

Started teaching myself how to code at around age 15 and am doing it to this very day!

Updated on July 05, 2022

Comments

  • cory ginsberg
    cory ginsberg almost 2 years

    I'm trying to recover an app that I accidentally deleted and managed to do it through the organizer, however, now when I try to run it on the simulator or iphone, it crashes with an error popping up in the main.m file:

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

    The error occurs in the "return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));" section of the file with the SIGABRT error. I am using Xcode 4.2 with ARC on. I am testing it on ios 4.3 and ios 5.0. The app was working before and in fact, is on the app store right now. Anything would help

  • gonzobrains
    gonzobrains almost 12 years
    When this happened to me, I had copied a project from another and didn't rename the view controller. I opened the nib file as source and renamed the offending lines accordingly and it worked.
  • Troy
    Troy about 9 years
    That was it for me! I changed the class of the root view controller and it didn't have some of the outlets the original class had.
  • Alberto Acuña
    Alberto Acuña almost 6 years
    where is the name of view controller? thanks u, I copiet too @gonzobrains