4

事件详细信息应该存储在哪里?如何为我不知道的特定事件发出警报。请帮助提供代码或提供该类型示例的链接。预先感谢。

4

2 回答 2

2

您可以使用本地通知,这里有一些用于安排通知的示例代码。

- (void)scheduleNotification {

    UILocalNotification *notif = [[UILocalNotification alloc] init];

    //notification for 3 days
    notif.fireDate = [NSDate dateWithTimeInterval:60.0f*60.0f*24.0f*3.0f sinceDate:[NSDate date]];
    notif.timeZone = [NSTimeZone defaultTimeZone];
    notif.alertBody = @"We've missed you!";
    notif.alertAction = @"PLAY";
    notif.soundName = UILocalNotificationDefaultSoundName;
    notif.applicationIconBadgeNumber = 1;
    [[UIApplication sharedApplication] scheduleLocalNotification:notif];

}
于 2012-07-10T04:52:45.320 回答
1

您可以在 iPhone 程序中以编程方式为未来日期的事件安排提醒。这是一个示例项目,它将帮助您以编程方式在 iPhone 中安排活动。检查此链接。https://developer.apple.com/library/ios/#samplecode/SimpleEKDemo/Introduction/Intro.html

于 2012-07-10T04:54:59.360 回答