如何在app My Example code:
中将警报实施为本地通知UILocalNotification* localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = pickerDate;
localNotification.alertBody = self.itemText.text;
localNotification.alertAction = @"Show me the item";
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.applicationIconBadgeNumber = [[UIApplication sharedApplication] applicationIconBadgeNumber] + 1;
由于
答案 0 :(得分:0)
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
在代码末尾添加此内容&确保选择有效日期&通知启动的时间。