ios - 我在 iOS 中遇到一些布局约束错误

标签 ios iphone autolayout

我得到一些错误日志信息,但是位置不是位置代码,你能帮我指出问题的原因吗

下面是崩溃日志的详细信息,我找不到更多的代码位置,有什么问题。

详细崩溃日志:

The layout constraints still need update after sending -updateConstraints to <_UIKeyboardLayoutAlignmentView: 0x13e6ea660; frame = (0 0; 0 0); userInteractionEnabled = NO; layer = <CALayer: 0x17443ffe0>>.
_UIKeyboardLayoutAlignmentView or one of its superclasses may have overridden -updateConstraints without calling super. Or, something may have dirtied layout constraints in the middle of updating them.  Both are programming errors.
(null)
(
    0   CoreFoundation                      0x0000000185d602f4 <redacted> + 160
    1   libobjc.A.dylib                     0x000000019758c0e4 objc_exception_throw + 60
    2   CoreFoundation                      0x0000000185d60218 <redacted> + 0
    3   UIKit                               0x000000018ae64748 <redacted> + 448
    4   UIKit                               0x000000018ae64880 <redacted> + 136
    5   CoreFoundation                      0x0000000185c40cdc CFArrayApplyFunction + 68
    6   UIKit                               0x000000018ae64620 <redacted> + 152
    7   UIKit                               0x000000018ae64880 <redacted> + 136
    8   CoreFoundation                      0x0000000185c40cdc CFArrayApplyFunction + 68
    9   UIKit                               0x000000018ae64620 <redacted> + 152
    10  UIKit                               0x000000018ae64880 <redacted> + 136
    11  UIKit                               0x000000018a89b7b4 <redacted> + 104
    12  Foundation                          0x0000000186bc1308 <redacted> + 176
    13  UIKit                               0x000000018a89b4d0 <redacted> + 212
    14  UIKit                               0x000000018a8b7e04 <redacted> + 104
    15  UIKit                               0x000000018ae64be4 <redacted> + 180
    16  UIKit                               0x000000018a7b2140 <redacted> + 588
    17  UIKit                               0x000000018ac71bd0 <redacted> + 792
    18  UIKit                               0x000000018aaa8fb0 <redacted> + 1860
    19  UIKit                               0x000000018a824240 <redacted> + 356
    20  UIKit                               0x000000018a7946ec <redacted> + 536
    21  CoreFoundation                      0x0000000185d182a4 <redacted> + 32
    22  CoreFoundation                      0x0000000185d15230 <redacted> + 360
    23  CoreFoundation                      0x0000000185d15610 <redacted> + 836
    24  CoreFoundation                      0x0000000185c412d4 CFRunLoopRunSpecific + 396
    25  GraphicsServices                    0x000000018f4576fc GSEventRunModal + 168
    26  UIKit                               0x000000018a806fac UIApplicationMain + 1488
    27  Myapp                               0x1001803b0 Myapp + 1573808
    28  libdyld.dylib                       0x0000000197c0aa08 <redacted> + 4
)

dSYM UUID: B1FB72DD-A4D0-3ABA-BF95-9FCD83749770
CPU Type: arm64
Slide Address: 0x0000000100000000
Binary Image: Myapp
Base Address: 0x00000001000f0000

最佳答案

如果您实现了 updateConstraints,则需要在您的实现中调用 [super updateConstraints];

参见 https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/index.html#//apple_ref/occ/instm/UIView/updateConstraints

更新:

_UIKeyboardLayoutAlignmentView 是 Apple 内部键盘 View 。最有可能的是某些东西在呈现时崩溃了。

查看此 Radar(Apple 错误报告)和这些答案以获得潜在的解决方案。 该错误似乎是 iOS 8.3 特有的。

https://openradar.appspot.com/20615507

NSInteralInconsistencyException - UIKeyboardLayoutAlignmentView

iOS 8.3 UIAlertController crashes when trying to add a textfield

关于ios - 我在 iOS 中遇到一些布局约束错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30448414/

相关文章:

ios - Swift - 解析 Facebook "Invalid redeclaration of ' applicationDidBecomeActive'”

ios - 在 Parse.com 上保存检索声音

iphone - iOS动态行宽

iphone - UITableViewCell -> 样式 : UITableViewCellStyleValue2 -> change indent

ios - 调整 4/3.5 英寸屏幕的 UICollectionViewCells 大小

ios - 从 Block 获取 WebService 响应到 WatchKit App

iOS 框架关系

iphone - 在显示 GLkit View 之前添加一些 View - 从 UIview 导航到 GLkit View

ios - UITextView 放置在自动布局中表现得很奇怪

ios - 匹配单独层次结构中自动布局 View 的宽度