2 for 2012 for_2012 于 2013.05.14 09:50 提问

代码在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'

1个回答

love_loveec
love_loveec   2013.05.14 17:30

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

CSDN移动问答

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!