在ios7中呈现ViewController崩溃使用自动布局

时间:2015-04-07 13:23:13

标签: autolayout presentviewcontroller

我正在使用包含三个垂直滚动视图的Horizo​​ntal ScrollView。我在所有三个垂直滚动视图中都有基本控件,如textfield,ImageViews,Buttons等。 我想使用Image picker控制器从库中添加图像。

我使用以下代码:

UIImagePickerController *pickerView = [[UIImagePickerController alloc] init];

pickerView.delegate = self;

pickerView.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

pickerView.allowsEditing = YES;

[self.navigationController presentViewController:pickerView animated:YES completion:^{ }];

它在iOS 8设备中运行良好,但在iOS 7中使用以下日志呈现PickerView时会崩溃。

*由于未捕获的异常终止应用程序' NSInternalInconsistencyException',原因:' {行:     UITransitionView:0x14e576a0.Height {id:828} == 2048 + 1 * 0x14d7f3f0.marker {id:751} + 2 * 0x14dbc9f0.marker {id:839}

UITransitionView:0x14e576a0.Width{id: 823} == 1536 + 1*0x14dadc30.marker{id: 835}

UITransitionView:0x14e576a0.minX{id: 833} == 0 + 2*0x14db3e70.marker{id: 832} + -0.5*0x14dadc30.marker{id: 835}

UITransitionView:0x14e576a0.minY{id: 834} == 0 + 2*0x14dc6cf0.marker{id: 838} + -1*0x14dbc9f0.marker{id: 839}

UIWindow:0x14d51950.Height{id: 740} == 2048 + 1*0x14d7f3f0.marker{id: 751}

UIWindow:0x14d51950.Width{id: 735} == 1536 + 1*0x14d7f3c0.marker{id: 748}

UIWindow:0x14d51950.minX{id: 745} == 0 + 2*0x14d7f820.marker{id: 744} + -0.5*0x14d7f3c0.marker{id: 748}

UIWindow:0x14d51950.minY{id: 747} == 0 + 2*0x14d7f250.marker{id: 746} + -0.5*0x14d7f3f0.marker{id: 751}

objective{id: 107} == {objective 0x14e40140: <1000:32, 800:1.60262e-05, 750:4.86549e-08, 251:-3.42752e-08, 250:-28, 100:160> + <750:-9.73026e-08, 251:6.85453e-08>*UIScrollView:0x14e3b460.Width{id: 341} + <750:2.43256e-07, 251:-1.71363e-07, 100:-7.45058e-08>*UIView:0x14e3c250.Width{id: 303}}

约束:             标记:0x14d7f3c0.marker {id:748}

<NSAutoresizingMaskLayoutConstraint:0x14d7f3f0 h=--- v=--- V:[UIWindow:0x14d51950(1024)]>       Marker:0x14d7f3f0.marker{id: 751}

<NSAutoresizingMaskLayoutConstraint:0x14dadc30 h=--& v=-&- H:[UITransitionView:0x14e576a0(768)]>        Marker:0x14dadc30.marker{id: 835}

<NSAutoresizingMaskLayoutConstraint:0x14db3e70 h=--& v=-&- UITransitionView:0x14e576a0.midX == + 384>       Marker:0x14db3e70.marker{id: 832}

<NSAutoresizingMaskLayoutConstraint:0x14dbc9f0 h=--& v=-&- UITransitionView:0x14e576a0.height == UIWindow:0x14d51950.height>        Marker:0x14dbc9f0.marker{id: 839}

<NSAutoresizingMaskLayoutConstraint:0x14dc6cf0 h=--& v=-&- UITransitionView:0x14e576a0.midY == UIWindow:0x14d51950.midY>        Marker:0x14dc6cf0.marker{id: 838}

<_UIWindowAnchoringConstraint:0x14d7f250 h=--- v=--- UIWindow:0x14d51950.midY == + 512>     Marker:0x14d7f250.marker{id: 746}

<_UIWindowAnchoringConstraint:0x14d7f820 h=--- v=--- UIWindow:0x14d51950.midX == + 384>     Marker:0x14d7f820.marker{id: 744}

整合调整: (没有)   统计:     8行。可变计数:           1 - &gt; 3           2 - &gt;五 }: 内部错误。无法找到传入头UI​​ScrollView的传出行头:0x14e3b460.Width {id:341},这应该永远不会发生。&#39; ***第一次抛出调用堆栈: (0x2fe78e83 0x3a5226c7 0x2fe78dc5 0x307de7b1 0x307de2e3 0x307da01d 0x325fc2b5 0x32892b97 0x325fb167 0x327131d3 0x32634ab7 0x326349cf 0x3228a413 0x3aa070af 0x3aa099a9 0x2fe435b1 0x2fe41e7d 0x2fdac471 0x2fdac253 0x34ab32eb 0x32661845 0xe8bc5 0x3aa1bab7) libc ++ abi.dylib:以NSException *

类型的未捕获异常终止

0 个答案:

没有答案