2013-04-25 26 views
1

我有一個UITextField接受用戶輸入來搜索服務器端的內容。 剛剛輸入英文時一切順利。當我嘗試輸入中文時,應用程序崩潰(但不是每次都是)。UIKeyboard在iOS 6.1輸入中文時崩潰

我得到了以下堆棧跟蹤:

Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0 Crashed: 
0 CoreGraphics     0x33a72568 argb32_image_mark + 1732 
1 CoreGraphics     0x33a97f6c argb32_shade + 380 
2 libRIP.A.dylib     0x33dd625c ripl_BltShade + 1116 
3 libRIP.A.dylib     0x33dd578c ripc_DrawShading + 4812 
4 CoreGraphics     0x33a9738e CGContextDrawLinearGradient + 170 
5 UIKit       0x35915a4a UIKBDrawLinearGradient + 38 
6 UIKit       0x35c63abe -[UIKeyboardCandidateUnsplitKeyboardToggleButton toggleButtonBackgroundImageWithHighlight:] + 302 
7 UIKit       0x35c63938 -[UIKeyboardCandidateUnsplitKeyboardToggleButton updateBackgroundImages] + 48 
8 UIKit       0x35c63bd4 -[UIKeyboardCandidateUnsplitKeyboardToggleButton setDrawsBackground:] + 44 
9 UIKit       0x35c636e8 -[UIKeyboardCandidateUnsplitKeyboardToggleButton initWithFrame:] + 108 
10 UIKit       0x35bc05ca -[UIKeyboardCandidateGridHeader initWithFrame:] + 434 
11 UIKit       0x35c605e0 -[UIKeyboardCandidateView_iPhone_Bar initWithFrame:] + 324 
12 UIKit       0x35c5ed72 +[UIKeyboardCandidateView sharedInstance] + 242 
13 UIKit       0x35a5022c -[UIKeyboardImpl updateTextCandidateView] + 340 
14 UIKit       0x358fd648 -[UIKeyboardImpl setCandidates:] + 296 
15 UIKit       0x35a4fda2 -[UIKeyboardImpl updateCandidateDisplayAsyncWithCandidates:forInputManager:] + 146 
16 TextInput      0x394aa802 -[TIWordSearchOperationGetCandidates completeSearchOnMainThreadWithResults:] + 94 
17 Foundation      0x3431049c __NSThreadPerformPerform + 456 
18 CoreFoundation     0x339cd8f4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12 
19 CoreFoundation     0x339cd158 __CFRunLoopDoSources0 + 208 
20 CoreFoundation     0x339cbf2a __CFRunLoopRun + 642 
21 CoreFoundation     0x3393f238 CFRunLoopRunSpecific + 352 
22 CoreFoundation     0x3393f0c4 CFRunLoopRunInMode + 100 
23 GraphicsServices    0x3751e336 GSEventRunModal + 70 
24 UIKit       0x3585b2b4 UIApplicationMain + 1116 

崩潰日誌每個應用程序崩潰的時間幾乎是一樣的。 我已經花了好幾天的時間找到解決方案。

有沒有人知道這件事?

-

我發現了一個問題,可能會導致此問題。

我使用ARC在我的項目,而在 - 根視圖控制器的[viewDidLoad中]消息,我創建一個子視圖控制器,以及兒童視圖控制器在 - [viewDidLoad中]消息,創建一個NSTimer並添加當前運行循環刷新子視圖控制器中的子圖層。

當我評論創建NSTimer的代碼後,崩潰消失了。

我會努力找到原因。

+0

在模擬器或設備上?設備和模擬器上的 – 2013-04-25 08:14:35

+0

,兩者都有時會崩潰。和堆棧跟蹤是一樣的。 – 2013-04-25 08:18:23

+0

它是iOS的依賴,我的意思是你試過在其他iOS? – 2013-04-25 09:01:13

回答

0

您是否使用過UIGraphicsBeginImageContextWithOptions,而不是通過UIGraphicsEndImageContext釋放Context。或類似的東西。

相關問題