I get that it is expected that a root controller will be installed in applications at the end of an application launch error

So, I read similar posts, and I think that I have everything I need. In the AppDelegate.m application, the function application: didFinishLaunchingwithoptionis looks like this:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { self.viewController = [[[ViewController_iPhone alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease]; } else { self.viewController = [[[ViewController_iPad alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease]; } self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; return YES; 

}

My appdelegate.h is as follows:

  @class ViewController; @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) ViewController *viewController; @end 

And finally, my main.m looks like this:

  int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } } 

Help PLease, the application just loads a black screen, I don’t know where the problem is.

-1
source share
1 answer

Make sure that you set the base name of the main nib file for iPhone and iPad on the tab with information about your target settings.

0
source

Source: https://habr.com/ru/post/1400325/


All Articles