iOS开发之UIAlertController报错原因
这是由于取消标题(cancelTitle)为空导致的
if (cancelTitle.length > 0) {
UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:cancelTitle style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
}];
[alertCtl addAction:actionCancel];
}
2、报错信息:UIAlertController can only have one action with a style of UIAlertActionStyleCancel
这是添加了多个UIAlertActionStyleCancel类型的选项,去掉多余的保留一个即可