App crashes while loading with error in main.m
Asked Answered
E

9

13

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

Espy answered 21/10, 2011 at 21:44 Comment(0)
A
8

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.

Animator answered 6/11, 2011 at 18:15 Comment(2)
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.Gand
where is the name of view controller? thanks u, I copiet too @GandAryan
T
7

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.

Trismus answered 22/10, 2011 at 4:16 Comment(0)
T
5

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

Tarryn answered 27/11, 2014 at 3:6 Comment(1)
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.Tetramethyldiarsine
Y
3

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...

Yankee answered 15/6, 2012 at 17:40 Comment(0)
G
1

I've seen this happen before if the following build settings are not there. OTHER_LDFLAGS = -ObjC -all_load

This is under Linking in the target.

Gibbosity answered 21/10, 2011 at 21:47 Comment(0)
C
1

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

Crocket answered 21/10, 2011 at 21:57 Comment(0)
C
1

It happened to me and all I did was changed the name of my image view and than changed it back later. But, I forgot to disconnect the other name after I deleted it. However, once I disconnected it from interface builder it worked.

Cauvery answered 29/7, 2012 at 4:41 Comment(0)
I
1

Crashed with LLDP debugger I changed to GDB and then it worked.

I got stuck with this problem too but not all the time only 1/2 launch. Absolutely no error in the console no nothing, just a signal SIGARBT. My AppDelegate did not even went to didFinishLaunchingWithOptions. Changing the debugger back to GDB (Edit Scheme… > (Info tab) Debugger > LLDB) solved the problem.

Isomeric answered 19/7, 2013 at 10:0 Comment(0)
A
0

To fix it, click on mainstoryboard i.e. Interface Builder, select the File Inspector tab, and uncheck Use autolayout. Alternatively, you can target iOS 6.0+-only devices and change the minimum target, if you absolutely must have autolayout. This problem occurs due to mismatch in versions of xcode and source of learning programs from.

Annettaannette answered 5/4, 2013 at 1:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.