2013-01-14 23 views
2

我讓我的應用間歇性崩潰。崩潰日誌讓我覺得UITextField的resignFirstResponser被調用的方式似乎存在一些問題。我在我的自定義tableview單元格中使用UITextField和UITextFieldDelegate協議方法,這會導致間歇性崩潰。我在下面發佈崩潰日誌。請任何建議或意見,可以幫助我瞭解崩潰的根本原因會很好。另外,好像死機大多發生在iOS 6resignFirstResponder崩潰而定製使用的UITextField UlTableViewCell

感謝。

以下是Crittercism崩潰日誌:

 

    0 libobjc.A.dylib 0x39d585b0 objc_msgSend + 16 + 15 
    1 UIKit 0x3477f165 -[UITextField _resignFirstResponder] + 457 + 456 
    2 UIKit 0x34664249 -[UIResponder resignFirstResponder] + 281 + 280 
    3 UIKit 0x34712397 -[UITextField resignFirstResponder] + 147 + 146 
    4 UIKit 0x346962f5 -[UITableView reloadData] + 225 + 224 
    5 BF 0x0008ed37 -[BFOpenBetsController updateFilterData] (BFOpenBetsController.m:768) 
    6 BF 0x0008d695 -[BFOpenBetsController deleteBet:] (BFOpenBetsController.m:566) 
    7 BF 0x00094fbd -[BFOpenBetsUnMatchedCell userTapOnButton:] (BFOpenBetsUnMatchedCell.m:198) 
    8 UIKit 0x347380a5 -[UIApplication sendAction:to:from:forEvent:] + 73 + 72 
    9 UIKit 0x34738057 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 31 + 30 
    10 UIKit 0x34738035 -[UIControl sendAction:to:forEvent:] + 45 + 44 
    11 UIKit 0x347378eb -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 503 + 502 
    12 UIKit 0x34737de1 -[UIControl touchesEnded:withEvent:] + 489 + 488 
    13 UIKit 0x34656421 _UIGestureRecognizerUpdate + 5769 + 5768 
    14 CoreFoundation 0x351536cd __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 21 + 20 
    15 CoreFoundation 0x351519c1 __CFRunLoopDoObservers + 277 + 276 
    16 CoreFoundation 0x35151d17 __CFRunLoopRun + 743 + 742 
    17 CoreFoundation 0x350c4ebd CFRunLoopRunSpecific + 357 + 356 
    18 CoreFoundation 0x350c4d49 CFRunLoopRunInMode + 105 + 104 
    19 GraphicsServices 0x32a172eb GSEventRunModal + 75 + 74 
    20 UIKit 0x346a12f9 UIApplicationMain + 1121 + 1120 

+0

崩潰的情況是什麼?在顯示或滾動等之後它會崩潰嗎? –

+0

@AkshayShah:其實這是一個Crittercism日誌。用戶在Live版本中看到它,我無法重現它,因此它似乎是一個間歇性問題。我的理解是它發生在tableView稍後重新加載的時候,所以可能就像滾動或更新tableView在初始數據顯示之後肯定不會在乞求中一樣。甚至滾動也不會一直崩潰。所以我想可能是我的textField被選中,然後tableView被重新加載或什麼的,但我不知道只是試圖從日誌中弄清楚事情。 –

回答

0

這有可能是你的UITextFields的一個被釋放(因爲他們做的時候滾出視,或者視圖時重新加載)。看到你有一個TextField委託,它可能不知道該字段不再存在,所以當它調用resign first responder時,它會崩潰。

解決辦法是打電話的UITextField setDelegate:無在您的自定義單元格的的dealloc例程。

請參閱https://stackoverflow.com/a/9484805/899996

0

似乎更新過濾數據時一樣,重新加載的tableview到時候一些UITextField在編輯模式。 嘗試用這樣的東西重現。

如果發生此問題,請在致電reloadData聯繫UITableView之前,在您所有的有效UITextField上嘗試使用resignFirstResponder

相關問題