編集:他の人がバグを見つけるのを助けるために、質問の前に「MethodSwizzleCrash」を付けました。
シミュレーターまたはiOS4以降を実行しているデバイスのベトナム語キーボードで押されたキーごとに、次のメッセージがコンソールに出力され、最初のレスポンダーに文字が送信されません。
Can't find transliterator file: vi_TelexTransliterator
utrans_transUChars error U_ILLEGAL_ARGUMENT_ERROR
サーバーまたはクライアントコードにこれらの文字列またはサブ文字列のインスタンスはありません。これはAPIから来ています。
iOS 4を実行しているシミュレーターとデバイスは、2回目のキーを押すと常にクラッシュします。iOS5ではクラッシュは発生しません。コールスタックの最上位のエラーは次のようになります。
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFString substringToIndex:]: Range or index out of bounds'
呼び出しスタックは次のようになります。
Foundation -[NSString substringToIndex:]
TextInput -[TIKeyboardInputManagerZephyr internalIndexToExternal:]
TextInput -[TIKeyboardInputManagerZephyr inputCount]
UIKit -[UIKeyboardImpl addInputString:fromVariantKey:]
UIKit -[UIKeyboardImpl handleStringInput:fromVariantKey:]
UIKit -[UIKeyboardImpl handleKeyEvent:]
UIKit -[UIApplication _handleKeyEvent:]
UIKit -[UIResponder(Internal) _handleKeyEvent:]
UIKit -[UIResponder(Internal) _handleKeyEvent:]
UIKit -[UIResponder(Internal) _handleKeyEvent:]
UIKit -[UIResponder(Internal) _handleKeyEvent:]
UIKit -[UIResponder(Internal) _handleKeyEvent:]
UIKit -[UIResponder(Internal) _handleKeyEvent:]
UIKit -[UIResponder(Internal) _handleKeyEvent:]
UIKit -[UIResponder(Internal) _handleKeyEvent:]
UIKit -[UIResponder(Internal) _handleKeyEvent:]
UIKit -[UIResponder(Internal) _handleKeyEvent:]
UIKit -[UIApplication handleKeyEvent:]
UIKit -[UIKeyboardLayoutStar sendStringAction:forKey:]
UIKit -[UIKeyboardLayoutStar touchUp:]
UIKit -[UIKeyboardLayout touchesEnded:withEvent:]
UIKit -[UIWindow _sendTouchesForEvent:]
UIKit -[UIWindow sendEvent:]
UIKit -[UIApplication sendEvent:]
UIKit _UIApplicationHandleEvent
GraphicsServices PurpleEventCallback
CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
CoreFoundation __CFRunLoopDoSource1
CoreFoundation __CFRunLoopRun
CoreFoundation CFRunLoopRunSpecific
CoreFoundation CFRunLoopRunInMode
GraphicsServices GSEventRunModal
GraphicsServices GSEventRun
UIKit -[UIApplication _run]
UIKit UIApplicationMain
APP main (main.m:XXX)
このキーボードは、メインビューが読み込まれる前のセキュリティ画面や、すべての入力処理メソッドがデリゲートにコメントアウトされているなど、アプリケーション全体のさまざまな場所で試しました。失敗は一貫しています。デリゲートメソッドが実装されていて、textField:shouldChangeCharactersInRange:replacementString:をステップ実行すると、受け取った文字列は有効です。
すべてがこれがAppleの問題であることを示しているようですが、私はこの問題に関する他の報告をオンラインで見つけていません。私の腸はそれが私のコードの何かだと言っています。誰かがヒントを貸すことができますか?