alertController和UIAlertView 使用示例

来源:互联网 发布:少林足球 知乎 编辑:程序博客网 时间:2024/05/28 04:53

-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification{

    NSLog(@"Application did receive local notifications");

    

//    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"标题" message:@"这个是UIAlertController的默认样式" preferredStyle:UIAlertControllerStyleAlert];

//    

//    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];

//    UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"好的" style:UIAlertActionStyleDefault handler:nil];

//    [alertController addAction:cancelAction];

//    [alertController addAction:okAction];

//    

//    [self presentViewController:alertController animated:YES completion:nil];

//    notification.alertBody = _titleCell.editTextField.text;

//    notification.alertAction = _titleCell.editTextField.text;

    

//    NSLog(@"BODY IS %@",notification.alertBody);

     UIAlertView *alertView = [[UIAlertViewalloc] initWithTitle:@"通知"message:notification.alertBody delegate:selfcancelButtonTitle:@"Cancel"otherButtonTitles:@"Sure",nil];

     [alertView show];

//    [application cancelAllLocalNotifications];

//    

//    [self cancelLocalNotificationWithKey:@"schedule"];

    

}


- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{

    

}

0 0
原创粉丝点击