Aaban Tariq Murtaza
Aaban Tariq Murtaza

Reputation: 1252

UITextField Crash on Touch -- iOS8

My Project was working good on iOS7. But When I tried it on iOs8, UITextFields Crashes the Application. I Added one BRAND NEW UITextField to one of my Story boards and touch that newly created UITextField (No delegates attached to textfield), Application crashed Again. I have waisted my Whole days on it, your help would be highly appreciated.

(
    0   CoreFoundation                      0x000000010d71af35 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010d3afbb7 objc_exception_throw + 45
    2   CoreFoundation                      0x000000010d721f4d +[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x000000010d67a27c ___forwarding___ + 988
    4   CoreFoundation                      0x000000010d679e18 _CF_forwarding_prep_0 + 120
    5   CoreFoundation                      0x000000010d60d13d CFStringGetCString + 173
    6   CoreFoundation                      0x000000010d6316ac CFLocaleCreateCanonicalLanguageIdentifierFromString + 76
    7   CoreFoundation                      0x000000010d698e0f CFStringTokenizerCreate + 847
    8   UIKit                               0x000000010c3b6d58 __91-[_UITextInputControllerTokenizer _getClosestTokenRangeForPosition:granularity:downstream:]_block_invoke44 + 253
    9   UIFoundation                        0x00000001154f406b -[NSTextStorage coordinateReading:] + 42
    10  UIKit                               0x000000010c3b6a29 -[_UITextInputControllerTokenizer _getClosestTokenRangeForPosition:granularity:downstream:] + 322
    11  UIKit                               0x000000010c0b279c -[UITextInputStringTokenizer positionFromPosition:toBoundary:inDirection:] + 72
    12  UIKit                               0x000000010c0b2e4e -[TIDocumentState(UITextInputAdditions) _contextBeforePosition:inDocument:] + 68
    13  UIKit                               0x000000010c0b2f91 -[TIDocumentState(UITextInputAdditions) initWithDocument:] + 110
    14  UIKit                               0x000000010c0b2aea +[TIDocumentState(UITextInputAdditions) documentStateOfDocument:] + 50
    15  UIKit                               0x000000010be49683 -[UIKeyboardImpl syncDocumentStateToInputDelegateWithExecutionContext:] + 288
    16  UIKit                               0x000000010be49edb -[UIKeyboardImpl updateForChangedSelectionWithExecutionContext:] + 296
    17  UIKit                               0x000000010c3b7914 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 332
    18  UIKit                               0x000000010be4471f -[UIKeyboardImpl setDelegate:force:] + 2031
    19  UIKit                               0x000000010c112a12 -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:] + 902
    20  UIKit                               0x000000010bdcf31d -[UIResponder becomeFirstResponder] + 468
    21  UIKit                               0x000000010bcc4e03 -[UIView(Hierarchy) becomeFirstResponder] + 99
    22  UIKit                               0x000000010c38bad7 -[UITextField becomeFirstResponder] + 51
    23  UIKit                               0x000000010c0139c1 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) setFirstResponderIfNecessary] + 177
    24  UIKit                               0x000000010c015a30 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) oneFingerTap:] + 2263
    25  UIKit                               0x000000010c00b2e6 _UIGestureRecognizerSendActions + 262
    26  UIKit                               0x000000010c009f89 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 532
    27  UIKit                               0x000000010c00eba6 ___UIGestureRecognizerUpdate_block_invoke662 + 51
    28  UIKit                               0x000000010c00eaa2 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 254
    29  UIKit                               0x000000010c004b1d _UIGestureRecognizerUpdate + 2796
    30  UIKit                               0x000000010bc9eff6 -[UIWindow _sendGesturesForEvent:] + 1041
    31  UIKit                               0x000000010bc9fc23 -[UIWindow sendEvent:] + 667
    32  UIKit                               0x000000010bc6c9b1 -[UIApplication sendEvent:] + 246
    33  UIKit                               0x000000010bc79a7d _UIApplicationHandleEventFromQueueEvent + 17370
    34  UIKit                               0x000000010bc55103 _UIApplicationHandleEventQueue + 1961
    35  CoreFoundation                      0x000000010d650551 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    36  CoreFoundation                      0x000000010d64641d __CFRunLoopDoSources0 + 269
    37  CoreFoundation                      0x000000010d645a54 __CFRunLoopRun + 868
    38  CoreFoundation                      0x000000010d645486 CFRunLoopRunSpecific + 470
    39  GraphicsServices                    0x00000001121bd9f0 GSEventRunModal + 161
    40  UIKit                               0x000000010bc58420 UIApplicationMain + 1282
    41  FIM                                 0x00000001092d88e1 main + 65
    42  libdyld.dylib                       0x000000010de50145 start + 1

Upvotes: 4

Views: 665

Answers (1)

Nikolay
Nikolay

Reputation: 76

For some reason Sergiy Salyuk didn't post answer, but his comment works.

Problem is in replacing initial array of languages in "AppleLanguages" from NSUserDefaults

It save a lot of times, since problem appears only on tester device, which in other country and I don't know how I will find out connection of crash with this trace and "AppleLanguages" in NSUserDefaults.

Thank you one more time Sergiy.

Upvotes: 6

Related Questions