время выполнения исключение наступает время, когда я показать UIAlertController (ActionSheet) в iOS8 Beta5 + Xcode6.время выполнения Исключение наступает время, когда шоу UIAlertController (actionsheet) iOS8
Эта ошибка происходит только в iPad Устройства.
Я получаю исключение при использовании UIAlertController.
* Нагрузочного приложение из-за неперехваченное исключение 'NSGenericException', причина: ': должен иметь не всухую SourceView или barButtonItem установить до появления презентации UIPopoverPresentationController ( 0x15794370> < _UIAlertControllerActionSheetRegularPresentationController).
Мой кода для отображения ActionSheet следующего
// Cancel Button
UIAlertAction *actionCancel = [UIAlertAction
actionWithTitle:NSLocalizedString(@"IDS_LABEL_CANCEL", nil)
style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
// cancel
//action handler
[self actionHandler:nil withTag:0 withButtonIndex:0];
}];
// print button
UIAlertAction *actionPrint = [UIAlertAction
actionWithTitle:NSLocalizedString(@"IDS_LABEL_PRINT", nil)
style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
//action handler
[self actionHandler:nil withTag:kAttachmentActionSheetTag withButtonIndex:0];
}];
// Create action sheet
UIAlertController *alertController = [UIAlertController
alertControllerWithTitle:nil message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
[alertController addAction:actionCancel];
[alertController addAction:actionPrint];
// show aciton sheet
[self presentViewController:alertController animated:YES
completion:nil] ;
Thankyou mmcomb. Ты просто спас меня. – Sabareesh
Вам не нужно 'sourceView' и' sourceRect', если у вас нет 'barButtonItem'? Обсуждение 'sourceRect' в документах:« Используйте это свойство вместе с свойством sourceView, чтобы указать местоположение привязки для popover ». –