我想切换到xib,所以删除了Main.storyboard。现在,应用程序崩溃了,调用didFinishLaunchingWithOptions
时没有任何输出登录[self.window makeKeyAndVisible]
。我已经清除了Target-General-Deployment Info中的Main Interface。崩溃是否与删除Main.storyboard时应删除的某些链接有关?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
MainViewController *mvc = [[MainViewController alloc] init];
UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:mvc];
self.window.rootViewController = nvc;
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return [[AWSMobileClient sharedInstance] didFinishLaunching:application withOptions:launchOptions];
}
0x10759e180的断点:
UIKit`-[UIWindow makeKeyAndVisible]:
0x10759e156 <+0>: pushq %rbp
0x10759e157 <+1>: movq %rsp, %rbp
0x10759e15a <+4>: pushq %rbx
0x10759e15b <+5>: pushq %rax
0x10759e15c <+6>: movq %rdi, %rbx
0x10759e15f <+9>: movq 0xc62182(%rip), %rsi ; "isHidden"
0x10759e166 <+16>: callq *0xce6074(%rip) ; (void *)0x0000000108f97800: objc_msgSend
0x10759e16c <+22>: testb %al, %al
0x10759e16e <+24>: je 0x10759e182 ; <+44>
0x10759e170 <+26>: movq 0xc63a11(%rip), %rsi ; "_orderFrontWithoutMakingKey"
0x10759e177 <+33>: movq %rbx, %rdi
0x10759e17a <+36>: callq *0xce6060(%rip) ; (void *)0x0000000108f97800: objc_msgSend
0x10759e180 <+42>: jmp 0x10759e194 ; <+62>
0x10759e182 <+44>: movq 0xc66a2f(%rip), %rsi ; "_updateLayerOrderingAndSetLayerHidden:"
0x10759e189 <+51>: xorl %edx, %edx
0x10759e18b <+53>: movq %rbx, %rdi
0x10759e18e <+56>: callq *0xce604c(%rip) ; (void *)0x0000000108f97800: objc_msgSend
0x10759e194 <+62>: cmpq %rbx, 0xce0045(%rip) ; _UIKeyWindow
0x10759e19b <+69>: je 0x10759e1b3 ; <+93>
0x10759e19d <+71>: movq 0xc66bfc(%rip), %rsi ; "makeKeyWindow"
0x10759e1a4 <+78>: movq %rbx, %rdi
0x10759e1a7 <+81>: addq $0x8, %rsp
0x10759e1ab <+85>: popq %rbx
0x10759e1ac <+86>: popq %rbp
0x10759e1ad <+87>: jmpq *0xce602d(%rip) ; (void *)0x0000000108f97800: objc_msgSend
0x10759e1b3 <+93>: addq $0x8, %rsp
0x10759e1b7 <+97>: popq %rbx
0x10759e1b8 <+98>: popq %rbp
0x10759e1b9 <+99>: retq
我终于发现,我新添加的xib缺少从View到ViewController的链接。在“文件的所有者”-“连接检查器”-“出口”中,将视图出口拖动到xib的视图中,然后问题解决了。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句