我没有任何代码处理或在didReceiveRemoteNotification方法中创建新的UIAlertView。简单地..
PFPush.handlePush(userInfo)
if application.applicationState == UIApplicationState.Active {
print("active")
}
当我在警告上按“确定”时,应用程序崩溃了exec_bad_access,堆栈卡在下面的完成(NSNotFound)行。
if ([UIAlertController class] != nil) {
__block UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title
message:message
preferredStyle:UIAlertControllerStyleAlert];
void (^alertActionHandler)(UIAlertAction *) = [^(UIAlertAction *action){
// This block intentionally retains alertController, and releases it afterwards.
if (action.style == UIAlertActionStyleCancel) {
completion(NSNotFound);
} else {
NSUInteger index = [alertController.actions indexOfObject:action];
completion(index - 1);
}
alertController = nil;
} copy];