2014-10-28 77 views
4

這僅在IOS 8 iPhone應用程序中發生,該應用程序在之前的版本中運行良好。來問題, 我有一個表視圖,其中包含文本字段和其他單元格。 textfield的所有代表都已實現。現在,當我點擊文本字段時,顯示鍵盤。雖然鍵盤仍然可見,但我點擊另一個單元,它將我帶到其他視圖,解除了鍵盤。現在,當我點擊這個新視圖中的後退按鈕以返回到先前的視圖時,該應用程序崩潰,顯示標題中提到的錯誤消息。 這用於在IOS 7和以前的版本中完美地工作。請幫忙。IOS 8: - [UIInputViewSet setRestorableResponder:]:發送到釋放實例的消息0x7d6659b0

按照問題添加堆棧跟蹤。

<_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 
) 
+0

您可以添加完整的堆棧跟蹤嗎? – 2014-10-28 12:59:54

+0

@MahmoudAdam:添加堆棧跟蹤 – 2014-10-29 12:28:20

回答

5

我也有類似的問題,是的,它變成了ŧ他正在釋放文本字段。我通過在推送新視圖控制器之前添加對endEditing的調用,將其固定在我的代碼中:

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

這是爲我修復的,我在控制器上使用[self setEditing:NO],但失敗了。 – beno1604 2014-12-01 15:34:13

+0

爲我工作。或者,您可以在視圖控制器的viewWillDisappear方法中調用「endEditing」。 – 2014-12-17 11:23:59

1

我認爲問題是,當到下一個視圖的轉換完成後, 所以這將是更好地瞭解它爲什麼被釋放並防止 所以請檢查下列夫婦的TextInput被釋放問題採取了問題的更深入的觀點:

How to debug 「message sent to deallocated instance」 in Xcode4?

ViewController respondsToSelector: message sent to deallocated instance (CRASH)

+0

我得到了問題。如果我直接將文本字段作爲子視圖添加到單元格的contentview,就會發生這種情況。創建自定義單元格已修復。謝謝。 – 2014-10-31 05:29:09