編輯:用「方法Swizzle崩潰」作爲前綴,以幫助其他人找到該錯誤。方法Swizzle崩潰:越南語鍵盤失敗並崩潰
對於在越南鍵盤上的模擬器或運行iOS 4或更高,下面的消息輸出到控制檯和沒有字符的任何裝置按壓每個密鑰被髮送到所述第一響應:
Can't find transliterator file: vi_TelexTransliterator
utrans_transUChars error U_ILLEGAL_ARGUMENT_ERROR
有我的服務器或客戶端代碼中沒有這些字符串或子字符串的實例。這是來自API。
運行iOS 4的模擬器和設備將在第二次按鍵時始終崩潰。目前在iOS 5在調用堆棧頂部的錯誤沒有崩潰是這樣的:
*** 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:時,接收到的字符串是有效的。
一切似乎表明,這是一個蘋果問題,但我沒有發現任何其他在線問題的報告。我的直覺說這是我的代碼中的東西。任何人都可以借給你一個提示嗎?
我剛剛爲此獲得了風滾草徽章。任何人都可以加入挑戰嗎? – AWrightIV
上述信息(以及當時可用的信息)不足以找到解決方案。事實證明,這是一個更廣泛的問題。它影響了3.0操作系統上的鍵盤以及越獄設備上的應用程序。有關決議的信息將在正式答覆中提供。 – AWrightIV