0

I have an old app (from 2013/2014) that I need to make small updates to. When I run it in iOS 8.1 simulator, it works fine.

When I run on iOS 10, it shows splash screen (Default-568h@2x.png) for 1 second, and crashes (both on simulator and on iPhone 5s).

I get Thread 1: signal SIGABRT error on "return" line in 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 is written in Objective-C and has no storyboard.

Please help me - I'm not developer, but need to get this fixed so I can upload update to AppStore.

PS - when I download this app from AppStore to iPhone 5s with iOS 10 it works fine, but the AppStore version is from summer 2014.

PS2 - I'm using Xcode 8.1

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Levchik
  • 496
  • 1
  • 5
  • 19
  • What is the full, human readable error shown in the console? – rmaddy Nov 16 '16 at 22:34
  • @rmaddy Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch' libc++abi.dylib: terminating with uncaught exception of type NSException – Levchik Nov 16 '16 at 22:53
  • Review [these search results on that error](http://stackoverflow.com/search?q=%5Bios%5D+Application+windows+are+expected+to+have+a+root+view+controller+at+the+end+of+application+launch). You are bound to find your issue. – rmaddy Nov 16 '16 at 22:55
  • @rmaddy thanks - your links helped solve this problem ... now app runs in simulator and on device with iOS 10 .. the only problem i now have - it stopped working on iPad ... – Levchik Nov 17 '16 at 16:38
  • For those who are fighting to figure out error in iOS 10, when using library/photos/media your app may be crashing with SIGABORT. You need to add some keys in Info.plist, check [this link.](http://stackoverflow.com/a/39631642/1223728) – Borzh Mar 31 '17 at 15:31

1 Answers1

1

So thanks to @rmaddy I found answere here

My AppDelegate.m was missing

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

after

   self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
   self.window.backgroundColor = [UIColor clearColor];

under didFinishLaunchingWithOptions

I also had to rename ViewController to my main view ...

Basically I still don't know what I'm doing, but app now works!!!

Community
  • 1
  • 1
Levchik
  • 496
  • 1
  • 5
  • 19