XCode 6项目在ios 7.1上的segue之后崩溃

时间:2014-11-15 00:44:24

标签: ios xcode swift

我的项目在iOS 8模拟器和我的设备(iPhone 5S,iOS 8)上运行良好,但是当我在7.1模拟器上运行时,每次我执行segue时它都会崩溃...

我正在粘贴日志的一部分。

如果我停用自动布局,它会毫无问题地运行。我试图杀死视图控制器上的约束,但我没有区别......

2014-11-15 02:39:14.574 My Project[26240:607] Objective: {objective 0x79163360: <251:84> + <750:-1.42636e-07>*0x78f7c920.negError{id: 215} + <999:2>*0x78fdf120.negError{id: 1389} + <999:2>*0x78fdf230.negError{id: 1392} + <999:1>*_UILayoutGuide:0x78fdf0b0.Width{id: 1390} + <999:1>*_UILayoutGuide:0x78fdf190.Width{id: 1393}}
2014-11-15 02:39:14.578 My Project[26240:607] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<NSISEngine: 0x79186230>{ Rows:
    0x78fdf120.posErrorMarker{id: 1388} == 0 + 1*0x78fdf120.negError{id: 1389} + 1*_UILayoutGuide:0x78fdf0b0.Width{id: 1390}
    0x78fdf230.posErrorMarker{id: 1391} == 0 + 1*0x78fdf230.negError{id: 1392} + 1*_UILayoutGuide:0x78fdf190.Width{id: 1393}
    UILayoutContainerView:0x78f5e630.Height{id: 276} == 960 + 2*0x78f7a4f0.marker{id: 285} + 1*0x78f81890.marker{id: 293}
    UILayoutContainerView:0x78f5e630.Width{id: 273} == 640 + 2*0x78f7a490.marker{id: 282} + 1*0x78f81860.marker{id: 290}
    UILayoutContainerView:0x78f5e630.minX{id: 279} == 0 + 2*0x78f6e210.marker{id: 278} + 

.... blah blah blah

  Integralization Adjustments:
(none)

  Statistics:
    26 rows. Variable counts:
          1 ->   9
          2 ->  12
          3 ->   4
          5 ->   1
}: internal error.  Cannot find an outgoing row head for incoming head 0x78f7c920.negError{id: 215}, which should never happen.'
*** First throw call stack:
(
    0   CoreFoundation                      0x002d91e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x01a978e5 objc_exception_throw + 44
    2   CoreFoundation                      0x002d8fbb +[NSException raise:format:] + 139
    3   Foundation                          0x007a6079 -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 256
    4   Foundation                          0x007a5ee3 -[NSISEngine optimize] + 183
    5   Foundation                          0x0091a6d8 -[NSISEngine withBehaviors:performModifications:] + 183
    6   Foundation                          0x007aa3c5 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
    7   UIKit                               0x00bdb830 -[UIView(Hierarchy) _postMovedFromSuperview:] + 313
    8   UIKit                               0x00bd9b0a __UIViewWasRemovedFromSuperview + 226
    9   UIKit                               0x00bd970a -[UIView(Hierarchy) removeFromSuperview] + 264
    10  UIKit                               0x00cbcb3b -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 339
    11  UIKit                               0x00cb4963 __49-[UINavigationController _startCustomTransition:]_block_invoke + 206
    12  UIKit                               0x012c4810 -[_UIViewControllerTransitionContext completeTransition:] + 99
    13  UIKit                               0x00b6ec94 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke103 + 680
    14  UIKit                               0x00be1435 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 306
    15  UIKit                               0x00bca6dc -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 267
    16  UIKit                               0x00bca9c8 -[UIViewAnimationState animationDidStop:finished:] + 80
    17  QuartzCore                          0x04a8abb4 _ZN2CA5Layer23run_animation_callbacksEPv + 304
    18  libdispatch.dylib                   0x0215d4d0 _dispatch_client_callout + 14
    19  libdispatch.dylib                   0x0214b726 _dispatch_main_queue_callback_4CF + 340
    20  CoreFoundation                      0x0033e43e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
    21  CoreFoundation                      0x0027f5cb __CFRunLoopRun + 1963
    22  CoreFoundation                      0x0027e9d3 CFRunLoopRunSpecific + 467
    23  CoreFoundation                      0x0027e7eb CFRunLoopRunInMode + 123
    24  GraphicsServices                    0x03cf45ee GSEventRunModal + 192
    25  GraphicsServices                    0x03cf442b GSEventRun + 104
    26  UIKit                               0x00b7af9b UIApplicationMain + 1225
    27  My Project                         0x0014744e top_level_code + 78
    28  My Project                         0x0014748b main + 43
    29  libdyld.dylib                       0x023a16d9 start + 1
    30  ???                                 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

6 个答案:

答案 0 :(得分:4)

我遇到了类似的崩溃。应用程序在iOS 8中运行正常,并且每次在iOS 7中执行特定的segue时都会崩溃。除了崩溃之外,在iOS 7中运行时,我们的View Controller视图布局不正确,在iOS 8中运行良好。

您使用的是比例高度/宽度限制吗?我在场景A中使用了相当多的一个,并且应用程序总是在一个segue到场景B之后崩溃。我禁用了场景A中的所有比例高度/宽度约束,并且应用程序不再崩溃,尽管布局显然是错误的。< / p>

这对我来说似乎是个错误。

答案 1 :(得分:2)

我遇到了类似的问题。花了几天时间才弄明白是什么触发了它。

我的应用程序在iPhone 5s(在模拟器中)在iOS 7中崩溃,但在iOS 8或其他设备上没有。当我的控制器被弹出时......以及在UIPageViewController中滚动控制器时,我得到了同样的错误(&#34;找不到传入头的传出行头...&#34;)。

在这两种情况下,问题都是因为我使用UIView.insertSubview:下面的子视图和UIView.bringSubviewToFront等API将全屏视图叠加在一起。解决方案/解决方法是更改​​我们的代码以动态添加/删除我们的视图,而不是堆叠它们并改组它们的顺序。

希望这可以帮助其他遇到同样问题的人。

答案 2 :(得分:1)

这个问题迟到了,但我认为我的回答可能对某人有所帮助。

此次崩溃也发生在我身上,情况和输出几乎相同。

我很确定这是一个错误。要解决此问题,请按住Ctrl键单击故事板,然后选择显示文件检查器。在检查器面板中,将storyboard的构建版本设置为 iOS 8.0及更高版本。现在一切都很好。

答案 3 :(得分:1)

这是一个布局问题。尝试删除一些可疑的子视图并运行。我用这种方法解决了这个问题。顺便说一句,我认为这是iOS7中的一个错误,它在iOS 8中得到了解决。

答案 4 :(得分:0)

绝对是iOS7 IB的错误。我有这个问题,通过首先识别有问题的约束然后从IB中删除它来解决它。然后简单地在viewDidLoad中使用NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:

以编程方式实例化约束

答案 5 :(得分:0)

我遇到了似乎相似的问题。我在我的视图中将push segue转换为另一个视图。什么。每次模拟器崩溃。我的理由很简单。 要使用push segue,必须从Navigation Controller管理ViewController。如果没有立即崩溃,在控制台中打印类似于&#34;无法在故事板中找到ViewController&#34;。 如何离开有两种方法: - 将视图嵌入导航控制器(有工具:菜单编辑器 - &gt;嵌入 - &gt;导航控制器 - 使用Modal Segue insted。

我希望这个答案有助于解决一些“怪异的问题”。崩溃。