Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c DismissViewController激活时应用程序崩溃:_Objective C_Ios_Uiviewcontroller_Presentmodalviewcontroller - Fatal编程技术网

Objective c DismissViewController激活时应用程序崩溃:

Objective c DismissViewController激活时应用程序崩溃:,objective-c,ios,uiviewcontroller,presentmodalviewcontroller,Objective C,Ios,Uiviewcontroller,Presentmodalviewcontroller,我有一个常规视图控制器,它尝试通过presentViewController或使用UINavigationController按下控制器来显示控制器 当我调用dismissViewControllerAnimated:方法或通过UINavigationController按下后退按钮时,应用程序将崩溃,并出现以下错误: 012-12-01 13:09:15.789 stats[12370:c07] *** Assertion failure in -[NSLayoutConstraint con

我有一个常规视图控制器,它尝试通过presentViewController或使用UINavigationController按下控制器来显示控制器

当我调用dismissViewControllerAnimated:方法或通过UINavigationController按下后退按钮时,应用程序将崩溃,并出现以下错误:

012-12-01 13:09:15.789 stats[12370:c07] *** Assertion failure in -[NSLayoutConstraint constant], /SourceCache/Foundation_Sim/Foundation-992/Layout.subproj/NSLayoutConstraint.m:560
2012-12-01 13:09:15.790 stats[12370:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '(null)'
*** First throw call stack:
(0x4ac012 0x1974e7e 0x4abe78 0x140af35 0x15253a2 0x1527cda 0x15274f1 0xdf4bbe 0xdf4da7 0x908be4 0x90905d 0x90905d 0x90905d 0x90905d 0x90905d 0x90905d 0x90905d 0x90905d 0x90905d 0x9045e6 0x90aaf4 0x902eed 0x97cad6 0xba9f44 0xba94eb 0x9a7a11 0x9a6ecd 0x9a6ecd 0x9a7bdb 0xa72739d 0x2e7b0 0xd71b5 0xd6f38 0xd8a19 0x4a01bd 0x4a00d6 0x4a024a 0xe27d69 0xe2913e 0x49bcf9 0x49b94e 0x4a01bd 0x4a00d6 0x4a024a 0xe27d69 0xe279da 0x49bcf9 0x49b94e 0x4a01bd 0x4a00d6 0x4a024a 0xe27d69 0xddb0a7 0x49bcf9 0x49b94e 0x4a01bd 0x4a00d6 0x4a024a 0xe27d69 0xe010cf 0x514753f 0x5159014 0x51497d5 0x452af5 0x451f44 0x451e1b 0x240c7e3 0x240c668 0x8bc65c 0x1e34d 0x2215)
libc++abi.dylib: terminate called throwing an exception
这在模拟器和设备上都会发生

以下是我如何介绍控制器:

UINavigationController

ChartViewController *chartViewer = [[ChartViewController alloc] initWithNibName:@"ChartViewController" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:chartViewer animated:YES];
presentViewController:

ChartViewController *chartViewer = [[ChartViewController alloc] initWithNibName:@"ChartViewController" bundle:[NSBundle mainBundle]];
[self presentViewController:chartViewer animated:YES completion:nil];

提前谢谢你的帮助

这可能是由新XCode上的自动布局功能造成的

如果启用了“使用自动布局”功能,请签入XIB。如果是,请禁用并重试:

是否检查了chartViewer对象是否已创建?在第一种情况下,你的应用程序中是否有navigationController?如果你正在使用自动布局协议,则没有帮助,但在这个特定场景中,自动布局是导致崩溃的原因,显然,用户没有使用自动布局。