我开发了一个在模拟器上运行良好但在 iPhone 上崩溃的应用程序。实际上,应用程序不会在初始化时崩溃,但是当我更改为另一个视图时。我意识到,当我更改为没有 Segue 的视图时,应用程序就会崩溃。例如,在执行
[self.navigationController pushViewController:detailViewController animated:YES];
崩溃是:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryBoard' in bundle NSBundle </var/mobile/Applications/EE37B62E-E345-4F69-A6F0-3F56CB23F7BF/tableview.app> (loaded)'
首先抛出调用堆栈:
(0x357d788f 0x37b7e259 0x335835fb 0x1ccad 0x332bd93d 0x33337627 0x352f1933 0x357aba33 0x357ab699 0x357aa26f 0x3572d4a5 0x3572d36d 0x373c9439 0x33239cd5 0x9a25 0x99c0)
terminate called throwing an exception(lldb)