App crashes while loading with error in main.m

2020-03-12 02:37发布

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

9条回答
贼婆χ
2楼-- · 2020-03-12 03:19

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.

查看更多
虎瘦雄心在
3楼-- · 2020-03-12 03:24

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.

查看更多
可以哭但决不认输i
4楼-- · 2020-03-12 03:25

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

查看更多
\"骚年 ilove
5楼-- · 2020-03-12 03:27

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.

查看更多
男人必须洒脱
6楼-- · 2020-03-12 03:28

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

查看更多
看我几分像从前
7楼-- · 2020-03-12 03:35

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.

查看更多
登录 后发表回答