我的应用程序抛出异常[self.window makeKeyAndVisible];在app delegate。
//获取信息
[PHTBannerManager getBannerdataWithSuccess:nil];
//设置window
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.masterVC = [PHTMasterViewController new];
self.window.rootViewController = _masterVC;
//启动视频
[self showMoviePlayer];
[self.window makeKeyAndVisible];
#1 0x000000010560f170 in +[UIStoryboard storyboardWithName:bundle:] ()
#2 0x0000000102122f2b in -[TLLaunchImage showLaunchStoryboard:maxTime:] ()
#3 0x0000000102122d96 in -[TLLaunchImage findLaunchImageMaxTime:] ()
#4 0x0000000102122acb in +[TLLaunchImage showLaunchImageInWindow:] ()
#5 0x0000000102197d66 in -[UIWindow(TLWindow) tlsw_becomeKeyWindow] ()
#6 0x00000001051114c7 in -[UIWindow _makeKeyWindowIgnoringOldKeyWindow:] ()
#7 0x0000000101eec006 in -[AppDelegate application:didFinishLaunchingWithOptions:] at /Users/tong/Desktop/XB工作/iOS_duduDoctor/duduDoctor/AppDelegate.m:76
#8 0x0000000102183d30 in -[NSObject(TLDelegateSW) tlsw_application:didFinishLaunchingWithOptions:] ()
#9 0x00000001050bb475 in -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] ()
#10 0x00000001050bbfbc in -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] ()
#11 0x00000001050bed2c in -[UIApplication _runWithMainScene:transitionContext:completion:] ()
#12 0x00000001050bdbf2 in -[UIApplication workspaceDidEndTransaction:] ()
答案 0 :(得分:0)
如果您使用的是XIB,请替换此行
self.masterVC = [PHTMasterViewController new];
带
self.masterVC = [[PHTMasterViewController alloc] initWithNibName:@"PHTMasterViewController" bundle:nil];