加载视图控制器我有一个IBAction为在我的项目,当用户按下按钮时,它应该加载一个新的视图控制器,但是代码似乎崩溃通过IBAction为
我的代码如下:
- (IBAction)PurchaseItem:(id)sender {
PurchasedViewController *purchaseContr = (PurchasedViewController *)
[self.storyboard instantiateViewControllerWithIdentifier:@"ShowAd"];
_purchaseController.productID = @"com.id";
purchaseContr.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:purchaseContr animated:YES completion:NULL];
}
当我在设备上运行应用程序,并按下按钮,应用程序坠毁在下面一行:
[self presentViewController:purchaseContr animated:YES completion:NULL];
我已经得到的信息是“主题1:1.3的断点”
我是崩溃日志:
你为什么使用故事板而不使用segues?另外...你有手动设置一个断点,导致你的应用程序“崩溃”? – nhgrif
我应该如何改变它以使用segues? – Omar
嗨,奥马尔!你还没有解决这个问题?好的,你可以发布整个崩溃日志? – Ilario