#define SHOWALERT(MESSAGE) UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:MESSAGE preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil]; [alertController addAction:okAction]; UIViewController *vc = [UIApplication sharedApplication].windows[0].rootViewController; [vc presentViewController:alertController animated:YES completion:nil];