简体   繁体   中英

Crash when dismissing UIActionSheet

I am facing a mysterious crash issue when running our app (64 bit complaint) inside another app. The crash happens within UIKit after UIActionSheet is dismissed.

Below is the sequence of actions I am performing:

  1. Tap on the action sheet button on right side of navigation bar.
  2. Tap on some action makes a server call.
  3. Tap on the action sheet button again and then tap on Edit button to bring the table in edit mode.
  4. Table comes in Edit mode but application crashes.

Console Logs:

2014-07-14 14:26:57.404 AppleEasyPay[677:60b] -[__NSCFType _canBecomeKeyWindow]: unrecognized selector sent to instance 0x15c6abb70

在此处输入图片说明

- (void)showDeleteRequestConfirmation:(id)iSender {
      self.actionSheet = [[UIActionSheet alloc] init];
      self.actionSheet.destructiveButtonIndex = 0;
      self.actionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
      [self.actionSheet addButtonWithTitle:MyLocalized(kDeleteButtonKey)];
      [self.actionSheet addButtonWithTitle:MyLocalized(kCancelButtonKey)];
      self.actionSheet.title = MyLocalized(kDeleteConfirmationMessageKey);
      self.actionSheet.tag = kDeleteConfirmationActionSheet;
      self.actionSheet.delegate = self;
      [self.actionSheet showInView:self.tableView];
}


- (void)showCompleteRequestConfirmaton:(id)iSender {
    if (self.totalQuantityScanned < self.totalQuantityToBeScanned) {
        self.actionSheet = [[UIActionSheet alloc] init];
            self.actionSheet.cancelButtonIndex = 1;
            [self.actionSheet addButtonWithTitle:MyLocalized(kCompleteButtonKey)];
            [self.actionSheet addButtonWithTitle:MyLocalized(kCancelButtonKey)];
            self.actionSheet.title = MyLocalized(kCompleteRequestMessageKey);
            self.actionSheet.tag = kCompleteConfirmationActionSheet;
            self.actionSheet.delegate = self;
            [self.actionSheet showInView:self.tableView];
    } else {
        [self completeRequest:iSender];
    }
}

It was a mysteriously weird issue. I just put a strong property for my UIAlerView which I was showing on tap on my first action sheet and put that in the header file and it worked. Putting the property in the extension was crashing it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM