代码在IOS5.1中崩溃,IOS6.1没事

下面的代码是从导航视图中调用出来的,在IOS5中运行时,最后一行报错引起崩溃,但是在6.1中运行正常,为什么?

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'

如果你在视图中用到自动布局(创建新),就会崩溃,因为只有在ios6中才有。

CSDN移动问答