Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITextField auto correction crash in iOS 4.3 on simulator

The UITextField's auto correction crashes my app on the simulator with iOS 4.3 sdk build target. Works fine on the device and in the simulator with iOS 4.2 sdk.

Anyone else experiencing this issue? I'm figuring its a bug with the 4.3 sdk?

As soon as I type the second character. Stack Trace

#0  0x01c01000 in objc_assign_ivar ()
#1  0x03b7ec34 in -[AppleSpell init] ()
#2  0x007e7538 in -[UITextChecker _checker] ()
#3  0x007e8de9 in -[UITextChecker checkSpellingOfString:startingAt:language:wrap:correction:] ()
#4  0x0b335725 in TIInputManagerZephyr::lookup_spellcheck_candidates(KB::String const&) ()
#5  0x0b3353f3 in TIInputManagerZephyr::lookup_static_dynamic_candidates(KB::String const&, KB::String const&, KB::Vector<KB::FPoint> const&, bool) ()
#6  0x0b332b2b in TIInputManager::lookup() ()
#7  0x0b332e18 in TIInputManager::autocorrection() ()
#8  0x0b34a06b in -[TIKeyboardInputManagerZephyr autocorrection] ()
#9  0x005cfbe8 in -[UIKeyboardImpl generateCandidatesWithCompletions:] ()
#10 0x005cfc3b in -[UIKeyboardImpl generateCandidates] ()
#11 0x005dca23 in -[UIKeyboardImpl addInputString:fromVariantKey:] ()
#12 0x005de71b in -[UIKeyboardImpl handleKeyEvent:] ()
#13 0x0070a2ee in -[UIKeyboardLayoutStar sendStringAction:forKey:] ()
#14 0x0070ed19 in -[UIKeyboardLayoutStar touchUp:] ()
#15 0x005ebda2 in -[UIKeyboardLayout touchesEnded:withEvent:] ()
#16 0x004b8ded in -[UIWindow _sendTouchesForEvent:] ()
#17 0x00499c37 in -[UIApplication sendEvent:] ()
#18 0x0049ef2e in _UIApplicationHandleEvent ()
#19 0x02011992 in PurpleEventCallback ()
#20 0x0176a944 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#21 0x016cacf7 in __CFRunLoopDoSource1 ()
#22 0x016c7f83 in __CFRunLoopRun ()
#23 0x016c7840 in CFRunLoopRunSpecific ()
#24 0x016c7761 in CFRunLoopRunInMode ()
#25 0x020101c4 in GSEventRunModal ()
#26 0x02010289 in GSEventRun ()
#27 0x004a2c93 in UIApplicationMain ()

Also at times, you will see a much simpler trace that simply starts at main, then ceases immediately on objc_assign_ivar. This happens also when typing in a text field, such as a UISearchBar.

like image 390
Schoob Avatar asked Mar 10 '11 08:03

Schoob


4 Answers

On the simulator, open Settings -> Keyboard and turn OFF all the options. This prevents the crash (until the bug is addressed).

like image 151
CraicDesign Avatar answered Nov 11 '22 06:11

CraicDesign


I am experiencing the same issue, running the 4.3 simulator on Lion Developer Preview 2. This is a bug in the simulator on Lion. I have been temporarily disabling autocorrection (setAutocorrectionType: UITextAutocorrectionTypeNo).

like image 37
Fran Avatar answered Nov 11 '22 06:11

Fran


We have to update Simulator 4.3 by following these steps:

  1. Go to Xcode -> Preferences -> Download
  2. Update iOS 4.3 Simulator

And Reset Simulator and run it again. It's done.

like image 6
Suresh Jagnani Avatar answered Nov 11 '22 07:11

Suresh Jagnani


Please file a bug report at http://bugreport.apple.com if you feel that there is a bug in the SDK.

But, to answer you, I am not experiencing the same issue, so it might be a problem in your code. Could you check the stack trace before the crash and see if there's something you're missing that somehow worked in older OS versions?

Reference: iOS Development guide

like image 3
Saurabh G Avatar answered Nov 11 '22 08:11

Saurabh G