【发布时间】:2010-08-09 17:43:42
【问题描述】:
我正在潜入 iOS 开发,并一直致力于开发一款闹钟应用程序以熟悉 iOS 平台和 SDK。我正在使用本地通知来处理我的警报,但我需要一些方法来管理我设置的本地通知,以便在我编辑或删除与它们关联的任何警报时可以更新它们。我想出了如何在安排本地通知后使用cancelLocalNotification: 函数取消安排本地通知,但我很难弄清楚如何检索与已编辑或删除的警报关联的本地通知对象,以便我可以使用该功能。我应该注意,用于创建本地通知的所有警报对象都存储在 Core Data DB 中,并且它们的接口定义为...
@interface Alarm : NSManagedObject
{
}
@property (nonatomic, retain) NSNumber * Snooze;
@property (nonatomic, retain) NSNumber * AlarmID;
@property (nonatomic, retain) NSString * Label;
@property (nonatomic, retain) NSDate * Repeat;
@property (nonatomic, retain) NSDate * Time;
@property (nonatomic, retain) NSNumber * Enabled;
@property (nonatomic, retain) NSString * Song;
@property (nonatomic, retain) NSString * Sound;
@end
- 有什么好方法可以管理我的应用计划的本地通知,以便我以后可以检索这些本地通知对象并在需要时重新安排它们?
- 有没有办法检索您的应用已安排的本地通知?
- 如果是这样,有没有办法唯一地识别它们?
非常感谢您的帮助!
【问题讨论】:
标签: ios iphone ipad cocoa-touch localnotification