简体   繁体   中英

Why does the iPhone load a black screen after the launch screens?

I have been creating my first iOS app for iPhone (iOS 8) since last year (iOS 7).

My iPhone app launches perfectly, loads the launch images properly, and then loads up a black screen. You can see the status bar at the top as well. It stays on this screen. It should be loading my main selected UIViewController .

My main interface is set properly and my info.plist file seems look fine.

I am not using storyboards. I prefer to use NIBs (I am old school).

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ // Override point for customization after application launch. 
sleep(1); 
return YES; 
} 

I do not hit viewDidLoad in my root UIViewController .

Your didFinishLaunchingWithOptions: method needs to create a UIWindow , instantiate a view controller, and set that as the root view controller for your window. Then you should call makeKeyAndVisible on the window.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM