开发者

How can we get Local Notification in iPhone

I want to add notification based on a开发者_Python百科 user defined time and date. How can I do that?


What you need to do is explained in the fine documentation.


UILocalNotification *notif = [[UILocalNotification alloc] init];
notif.alertBody = @"HI";
[notif setFireDate:DATE];// fire the notification in ten minutes
notif.alertAction = @"View";
notif.timeZone = [NSTimeZone defaultTimeZone];
[[UIApplication sharedApplication] scheduleLocalNotification:notif];


Setup a UILocalNotification and schedule it with scheduleLocalNotification: of UIApplication.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜