IPhone gets black screen when application starts

I get a black screen whenever my application launches. There is no error message, and I installed my main nib file in the .plist file. Here is my code.

Appdelegate.h

#import <UIKit/UIKit.h> @class LoginController; @interface ViiadAppDelegate : NSObject <UIApplicationDelegate> { } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet LoginController *viewController; @end 

AppDelegate.m

 #import "AppDelegate.h" #import "LoginController.h" @implementation AppDelegate @synthesize window=_window; @synthesize viewController=_viewController; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; return YES; } 

Thanks in advance. I am new to iPhone development.

+4
source share
5 answers

Since you changed the rootViewController from MainWindow, you need to make sure that your MainWindow.xib viewpoint is set to your new view controller.

+7
source

In my case, I changed the Main Interface in the "Target Application Settings" window. Restoring it to MainWindow solved the problem.

+2
source

Is it only when the application starts? You may encounter a splash screen, and since you have not uploaded the image, the default is black. To change the screen saver, add a 320x480 project with the name "default.png" to the project.

+1
source

The black screen is the delay that the application takes to launch the user interface. There are certain things you can do to speed this up.

  • you need to put the splash screen as mentioned by the spear. This should not think that it allows you to interact with the user (perhaps hide buttons or gray in the image), so the user knows that the application is loading, but not yet loaded.

  • you should not have any locks (e.g. network connection) on your wakefulness from the nib function, as this blocks the main thread of execution

0
source

You can specify what are called "default images." They are visible at the time the application starts (automatically processed by iOS).

Here is a link where you could learn more about this:

http://developer.apple.com/library/ios/#DOCUMENTATION/UserExperience/Conceptual/MobileHIG/IconsImages/IconsImages.html

http://developer.apple.com/library/ios/#DOCUMENTATION/UserExperience/Conceptual/MobileHIG/IconsImages/IconsImages.html

0
source

All Articles