iOS 8 : -[UIInputViewSet setRestorableResponder:]: message sent to deallocated instance 0x7d6659b0

标签 ios objective-c iphone ios8 xcode6

这只发生在 IOS 8 iPhone 应用程序上,该应用程序在以前的版本中运行良好。谈到这个问题, 我有一个 TableView ,其中包含文本字段和其他单元格。 textfield 的所有委托(delegate)都已实现。现在,当我单击文本字段时,会显示键盘。虽然键盘仍然可见,但我单击了另一个将我带到其他 View 的单元格,关闭了键盘。现在,当我单击此新 View 中的后退按钮返回上一个 View 时,应用程序崩溃并显示标题中提到的错误消息。 这曾经在 IOS 7 和以前的版本中完美运行。请帮忙。

按照要求添加堆栈跟踪。

<_NSCallStackArray 0x802a7b30>(
0   ???                                 0x15daa77d 0x0 + 366651261,
1   Application                         0x002e63f0 main + 0,
2   CoreFoundation                      0x06e12fae _CF_forwarding_prep_0 + 14,
3   UIKit                               0x058bb318 -[UIPeripheralHost(UIKitInternal) _restoreInputViewsWithId:animated:] + 701,
4   UIKit                               0x054cdd7d -[UINavigationController navigationTransitionView:didStartTransition:] + 849,
5   UIKit                               0x054c569b -[UINavigationController _startCustomTransition:] + 3843,
6   UIKit                               0x054d2726 -[UINavigationController _startDeferredTransitionIfNeeded:] + 712,
7   UIKit                               0x054d3372 -[UINavigationController __viewWillLayoutSubviews] + 57,
8   UIKit                               0x0564704c -[UILayoutContainerView layoutSubviews] + 213,
9   UIKit                               0x053cedd1 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 608,
10  libobjc.A.dylib                     0x07cf7771 -[NSObject performSelector:withObject:] + 70,
11  QuartzCore                          0x069bc28f -[CALayer layoutSublayers] + 152,
12  QuartzCore                          0x069b0115 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 397,
13  QuartzCore                          0x069aff70 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26,
14  QuartzCore                          0x0690e3c6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 284,
15  QuartzCore                          0x0690f78c _ZN2CA11Transaction6commitEv + 392,
16  QuartzCore                          0x0690fe58 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92,
17  CoreFoundation                      0x06de59de __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30,
18  CoreFoundation                      0x06de5920 __CFRunLoopDoObservers + 400,
19  CoreFoundation                      0x06ddb35a __CFRunLoopRun + 1226,
20  CoreFoundation                      0x06ddabcb CFRunLoopRunSpecific + 443,
21  CoreFoundation                      0x06dda9fb CFRunLoopRunInMode + 123,
22  GraphicsServices                    0x0865124f GSEventRunModal + 192,
23  GraphicsServices                    0x0865108c GSEventRun + 104,
24  UIKit                               0x053438b6 UIApplicationMain + 1526,
25  Application                         0x002e6491 main + 161,
26  libdyld.dylib                       0x0806cac9 start + 1
)

最佳答案

我有一个类似的问题,是的,原来文本字段正在被释放。我通过在推送新 View Controller 之前添加对 endEditing 的调用来修复它:

[self.view endEditing:YES];
[self.navigationController pushViewController:...
                                     animated:YES];

关于iOS 8 : -[UIInputViewSet setRestorableResponder:]: message sent to deallocated instance 0x7d6659b0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26608360/

相关文章:

ios - Parse.com 保存图像 IOS

iphone - json 解析返回的数据顺序与 json 字符串不同

iphone - 将 UIView 加载到数组中然后使用它们

objective-c - 带有圆角的 UIView,但内容不是圆角的

ios - 如何使用 NSDictionary 将数据值传递给其他 ViewController Objective-C?

ios - Cocos2d-x如何创建带有标题和字体的图片按钮

ios - 移除 UIBarButtonItem 的文本阴影

web-applications - 通过javascript/html将网络应用程序安装到主屏幕

ios - 如何使用 UICollectionViewFlowLayout 将集合中的每个 View 居中?

ios - 如何在 ios6 下的 MapView 中重现切换 setUserTrackingMode 的按钮?