4

This is happening only with IOS 8 iPhone app, the app just worked fine with previous version. Coming to the issue, I have a table view, which contains both text fields and other cells. All the delegates of textfield are implemented. Now, when i click on text field, keyboard is shown. While the keyboard is still visible, i clicked on another cell which takes me to other view, dismissing the keyboard. Now, when i click on the back button in this new view to return to previous view, the app is crashing showing the error message as mentioned in title. This used to work perfectly in IOS 7 and previous releases. Please help.

Addind the stack trace as asked.

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

2 Answers2

5

I had a similar problem and yes, it turned out the text field was being deallocated. I fixed it in my code by adding a call to endEditing before pushing on the new view controller:

[self.view endEditing:YES];
[self.navigationController pushViewController:...
                                     animated:YES];
  • This is what fixed it for me, I was using [self setEditing:NO] on the controller, but that failed. – beno1604 Dec 01 '14 at 15:34
  • Worked for me. Alternatively, you can make the call to `endEditing` in your view controller's `viewWillDisappear` method. – Arnaud Dec 17 '14 at 11:23
1

I think the problem is that the TextInput was deallocated when the transition to the next view is done, so it will be better to know why it was been deallocated and prevent that so check the following couple of questions to take more in-depth view of the problem:

How to debug “message sent to deallocated instance” in Xcode4?

ViewController respondsToSelector: message sent to deallocated instance (CRASH)

Community
  • 1
  • 1
Mahmoud Adam
  • 5,772
  • 5
  • 41
  • 62
  • I got the issue. This happens if i add a textfield directly as a subview to the cell's contentview. Creating a custom cell has fixed. Thanks. – Dileep Kumar Oct 31 '14 at 05:29