嗨,我在做一个提醒应用程序。
我需要在某个特定的时间后显示一个提醒警报。
在我们设置日期选择器时,不是。
就像我有一个按钮‘10分钟后提醒’
-(IBAction)ReminderClick:(id)sender
{
}当用户按下按钮时,10分钟后需要显示一个警报.。
发布于 2012-04-26 06:32:19
您需要对此函数代码使用UILocalNotification,如下所示
UIApplication* app = [UIApplication sharedApplication];
UILocalNotification* notifyAlarm = [[UILocalNotification alloc] init];
NSDate *date1=[fire dateByAddingTimeInterval:60];
notifyAlarm.fireDate = date1;
notifyAlarm.timeZone = [NSTimeZone defaultTimeZone];
//notifyAlarm.timeZone = [NSTimeZone defaultTimeZone];
notifyAlarm.repeatInterval =NSWeekCalendarUnit ;
notifyAlarm.soundName =soundString;
notifyAlarm.alertBody =snoozeBody;
notifyAlarm.userInfo=snoozeDict;
//notifyAlarm.alertLaunchImage=@"in.png";
[app scheduleLocalNotification:notifyAlarm]; 您可以按照本http://www.icodeblog.com/tag/uilocalnotification/教程进行操作。
http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/
http://www.iostipsandtricks.com/ios-local-notifications-tutorial/
http://www.youtube.com/watch?v=tcVoq488-XI
发布于 2012-04-26 06:24:55
为此,您必须使用UILocalNotificataion
https://stackoverflow.com/questions/10328168
复制相似问题