main中出现SIGABRT错误.m -应用程序仅在iOS10中崩溃(在ios8中运行良好)



我有一个旧的应用程序(从2013/2014),我需要做小的更新。当我在ios8.1模拟器中运行它时,它工作得很好。

当我在iOS 10上运行时,它会显示开机画面(Default-568h@2x.png) 1秒,然后崩溃(在模拟器和iPhone 5s上都是如此)。

我得到线程1:信号SIGABRT在MAIN中的"返回"行错误。M

#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

App是用Objective-C编写的,没有故事板。

请帮助我-我不是开发人员,但需要得到这个固定,所以我可以上传更新到AppStore。

PS -当我从AppStore下载这个应用程序到iOS 10的iPhone 5s时,它运行良好,但AppStore版本是从2014年夏天开始的。

PS2 -我使用Xcode 8.1

所以感谢@rmaddy,我在这里找到了答案

我AppDelegate

。M不见了

[self.window makeKeyAndVisible];
ViewController *cont = [[ViewController alloc]init];
[self.window setRootViewController:cont];

   self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
   self.window.backgroundColor = [UIColor clearColor];
在<<p> strong> didFinishLaunchingWithOptions

我还必须将ViewController重命名为我的主视图…

基本上我仍然不知道我在做什么,但应用程序现在工作!!

最新更新