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
.
精彩评论