2014-02-19 3 views
2

Стек как ниже, как исправить эту ошибку? Это только в iOS7 и почему в стеке есть uitableview?UIAlertView сбой частного метода на iOS7

0 libobjc.A.dylib objc_msgSend + 5 
1 UIKit -[UIAlertView(Private) modalItem:shouldDismissForButtonAtIndex:] + 62 
2 UIKit -[_UIModalItemsCoordinator _notifyDelegateModalItem:tappedButtonAtIndex:] + 94 
3 UIKit -[_UIModalItemAlertContentView tableView:didSelectRowAtIndexPath:] + 894 
4 UIKit -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1078 
5 UIKit -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 214 
6 UIKit _applyBlockToCFArrayCopiedToStack + 316 
7 UIKit _afterCACommitHandler + 430 
8 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20 

- (id)initWithIdentifier:(LTAlertMsgIdentifier)alertIdentifier 
       delegate:(id /*<UIAlertViewDelegate>*/)delegate 
     cancelButtonTitle:(NSString *)cancelButtonTitle 
     otherButtonTitles:(NSString *)otherButtonTitles, ... { 

    LTAlertMsgManager *sharedAlertMsgMgr = [LTAlertMsgManager shareAlertManageInstance]; 

    NSString *strMsg = [sharedAlertMsgMgr getLTAlertMsgByAlertID:alertIdentifier]; 
    if ([NSString isBlankString:strMsg]){ 
     // alert is invalid, if alert message is empty 
     return nil; 
    } 

    NSString *strTitle = [sharedAlertMsgMgr getLTAlertTitleByAlertID:alertIdentifier]; 
    if (self = [super initWithTitle:([NSString isBlankString:strTitle] ? nil : strTitle) 
          message:strMsg 
          delegate:delegate 
        cancelButtonTitle:cancelButtonTitle 
        otherButtonTitles:nil]){ 
     va_list args; 
     va_start(args, otherButtonTitles); 
     for (NSString *arg = otherButtonTitles; arg != nil; arg = va_arg(args, NSString*)) 
     { 
      [self addButtonWithTitle:arg]; 
     } 
     va_end(args); 
    } 

    NSLog(@"cancel button index - %d", self.cancelButtonIndex); 
    return self; 

} 
+0

, пожалуйста, покажите нам didSelectRowAtIndexPath: – Pfitz

+1

Опишите предупреждение. Что вы делаете в момент его срыва. – Wain

+0

UIAlertView не предназначен для подкласса. – vikingosegundo

ответ

2

Кнопки в UIAlertView реализованы с использованием UITableView. Вот почему нажатие кнопки вызывает tableView:didSelectRowAtIndexPath.

Типичные проблемы, вызывающие такие ошибки являются:

  1. оповещения не отображается из главного потока
  2. Делегат уже высвобождены (убедитесь, что сигнал тревоги делегат сохраняется где-то в течение всего срока службы оповещения).
+0

Весь стек выглядит так, как показано ниже, и я не могу воспроизвести эту проблему. Поэтому я не могу отслеживать и исправлять это. Только просмотрите код, связанный с предупреждением? Благодаря! – user3327566

+0

@ user3327566 Код, который вы добавили, является okey. Более важно то, как отображается предупреждение и его делегат. – Sulthan

Смежные вопросы