1

此代码是从我的“设置”选项卡内的“导航”视图中调用的。它在 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'
4

1 回答 1

13

如果您在呈现的视图中使用自动布局(如果您在默认情况下创建了一个新的笔尖),它将崩溃,因为自动布局仅在 ios 6 中引入。(来源:raywenderlich.com这是禁用它的方法

于 2013-05-13T19:22:28.597 回答