notification.fireDate=[now dateByAddingTimeInterval:1]; //触发通知的时间 notification.repeatInterval=0; //循环次数,kCFCalendarUnitWeekday一周一次 notification.timeZone=[NSTimeZone defaultTimeZone]; notification.soundName = UILocalNotificationDefaultSoundName; notification.alertBody=msg; notification.alertAction = @"打开"; //提示框按钮 notification.hasAction = YES; //是否显示额外的按钮,为no时alertAction消失 notification.applicationIconBadgeNumber = 0; //设置app图标右上角的数字 [[UIApplication sharedApplication] scheduleLocalNotification:notification];