我在仅限iPad的应用程序中仅在iOS 9上发生崩溃.它说NSInternalinconsistencyException.
它出现在纵向和横向模式以及许多iPad代(iPad 2,iPad Pro,iPad 4,……)上.
我没有在项目中的任何位置启用自动布局,但它看起来像是自动布局问题.
它很难复制,所以我无法在Xcode上调试它,但我看到有关崩溃分析服务“Crashlytics”的报告.这是来自Crashlytics的堆栈跟踪:
auto layout internal error. Cannot find an outgoing row head for incoming head <unkNown var (BUG!) with engine as delegate[...]Thread : Fatal Exception: NSInternalinconsistencyException0 CoreFoundation 0x23d4568b __exceptionPreprocess1 libobjc.A.dylib 0x356c2e17 objc_exception_throw2 CoreFoundation 0x23d455d1 -[NSException initWithCoder:]3 Foundation 0x24a873b3 -[NSISEngine minimizeConstantInObjectiveRowWithhead:]4 Foundation 0x24a86e4d -[NSISEngine optimize]5 Foundation 0x24a82a53 -[NSISEngine withBehaviors:performModifications:]6 UIKit 0x27e040bb -[UIVIEw(HIErarchy) _postMovedFromSupervIEw:]7 UIKit 0x280fb227 __UIVIEwWasRemovedFromSupervIEw8 UIKit 0x27e02ddb -[UIVIEw(HIErarchy) removeFromSupervIEw]9 UIKit 0x282e5fa9 -[UIKeyboardPredictionVIEw setPredictionVIEwState:animate:notify:]10 UIKit 0x281e3787 -[UIKeyboardImpl updatePredictionVIEw]11 UIKit 0x27f155e3 -[UIKeyboardImpl finishLayoutChangeWithArguments:]12 UIKit 0x27e31437 -[UIKeyboardImpl updateLayout]13 UIKit 0x27e36077 -[UIKeyboardImpl setDelegate:force:]14 UIKit 0x27e2f6e1 -[UIPeripheralHost(UIKitInternal) _reloadinputVIEwsForResponder:]15 UIKit 0x27e2f20d -[UIResponder(UIResponderinputVIEwAdditions) reloadinputVIEws]16 UIKit 0x27e8d853 -[UIResponder becomeFirstResponder]17 UIKit 0x27e8db6d -[UIVIEw(HIErarchy) becomeFirstResponder]18 UIKit 0x27f12289 -[UITextFIEld becomeFirstResponder]19 UIKit 0x27fbe69f -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) setFirstResponderIfNecessary]20 UIKit 0x27fbdc75 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) oneFingerTap:]21 UIKit 0x28334e27 _UIGestureRecognizerSendTargetActions22 UIKit 0x27fa2303 _UIGestureRecognizerSendActions23 UIKit 0x27e3a7af -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:]24 UIKit 0x28335f2f ___UIGestureRecognizerUpdate_block_invoke80925 UIKit 0x27dfc287 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks26 UIKit 0x27df9e77 _UIGestureRecognizerUpdate27 UIKit 0x27e386f9 -[UIWindow _sendGesturesForEvent:]28 UIKit 0x27e37e43 -[UIWindow sendEvent:]29 UIKit 0x27e097e5 -[UIApplication sendEvent:]30 UIKit 0x27e07fdf _UIApplicationHandleEventQueue31 CoreFoundation 0x23d08c3f __CFRUNLOOP_IS_CALliNG_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__32 CoreFoundation 0x23d0882d __CFRunLoopDoSources033 CoreFoundation 0x23d06b9b __CFRunLoopRun34 CoreFoundation 0x23c5a249 CFRunLoopRunspecific35 CoreFoundation 0x23c5a035 CFRunLoopRunInMode36 GraphiCSServices 0x2cd24ad1 GSEventRunModal37 UIKit 0x27e6f899 UIApplicationMain38 Mr Appliance 0xcda7b main (main.m:16)39 libdyld.dylib 0x35e0e873 start
问题是我不知道代码在哪里发生了.堆栈跟踪不会显示代码中发生崩溃的位置.它只说main.m第16行返回UIApplicationMain(argc,argv,nil,NsstringFromClass([AppDelegate class]));.
解决方法 main.m中的那一行是程序开始运行的地方,而不是错误发生的地方.在所有其他项目发生后,在列表顶部的#1处抛出异常.问题在于介于两者之间.在从超级视图中删除一些视图之后会出现异常,并且它确实显示NSISEngine错误,表明可能已为某些XIB或Storyboard打开了autoLayout – 否则iOS会在内部使用autoLayout来处理新布局的排列.
This answer具有几乎相同的堆栈跟踪&指出使用不正确的手势方法处理firstResponder更改和解除键盘的问题.如果你正在做类似的事情(忽略一些视图,编辑UItableVIEw?),可能是错误的方法指向一个不存在的委托?
https://stackoverflow.com/questions/33800918/uitextfIEld-becomefirstresponder-crashes-the-ios-app-randomly
总结以上是内存溢出为你收集整理的iOS 9上的自动布局崩溃,禁用了自动布局全部内容,希望文章能够帮你解决iOS 9上的自动布局崩溃,禁用了自动布局所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)