SRI*_*SRI 1 iphone cocoa-touch ios
我想创建一个应用程序,它可以让你在我的iPhone应用程序中设置一个警报,然后即使我的应用程序没有运行它也被激活.
我该如何实现?
你想用UILocalNotification.在潜入之前需要注意几点:
话虽如此,你可以开始:
UILocalNotification *notif = [[UILocalNotification alloc] init];
notif.alertBody = @"This is a Local Notification";
NSDate *date = [NSDate date];
notif.fireDate = [date addTimeInterval:600];// fire the notification in ten minutes
[[UIApplication sharedApplication] scheduleLocalNotification:notif];
[notif release];
Run Code Online (Sandbox Code Playgroud)
如果您需要更多帮助,请发表评论:)
| 归档时间: |
|
| 查看次数: |
1050 次 |
| 最近记录: |