此代碼在我的「設置」選項卡內的導航視圖中調用。它在iOS 5.1的最後一行崩潰,但是不是 iOS 6.爲什麼?爲什麼此代碼在iOS 5.1中崩潰但不是iOS 6?
else if (indexPath.section == 0 && [[settingsArray objectAtIndex:indexPath.row] isEqualToString:@"Unlock Premium Features"])
{
InAppViewController *inappController = [[InAppViewController alloc] initWithNibName:@"InAppViewController" bundle:nil];
inappController.titleString = @"Upgrade to Pro.";
EditNavController *navController = [[EditNavController alloc] initWithRootViewController:inappController];
[self.navigationController presentModalViewController:navController animated:NO];
}
它崩潰上:
[self.navigationController presentModalViewController:navController animated:NO];
這裏是崩潰:
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'
任何特定的crash mes鼠尾草/堆棧跟蹤/任何東西? – 2013-05-13 19:19:23
它在'presentModalViewController'行崩潰了嗎? – Popeye 2013-05-13 19:21:06
你確定這不是相反嗎? 'presentModalViewController'在iOS 6中已被棄用。它可以被presentViewController替代:animated:completion。 (http://stackoverflow.com/questions/12507455/a-lot-of-functions-are-deprecated-ios-6) – leanne 2013-05-13 19:25:11