【发布时间】:2011-05-04 03:08:36
【问题描述】:
我正在尝试从已设置的通知中获取 fireDate
这是我的代码:
NSArray *notificationArray = [[NSArray alloc] initWithObjects:[[UIApplication sharedApplication] scheduledLocalNotifications], nil];
if ([notificationArray count] > 0) {
NSDate *now = [NSDate date];
UILocalNotification *locNotification = [[UILocalNotification alloc] init];
locNotification = [notificationArray objectAtIndex:0];
NSDate *otherDate = locNotification.fireDate;
}
当我尝试实例化我得到的 otherDate 时,locNotification 具有值,但最后一行
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM fireDate]: unrecognized selector sent to instance 0x1e4e20'
* 首次抛出时调用堆栈:
我真的不知道我做错了什么。
提前致谢
【问题讨论】:
标签: iphone date nsdate uilocalnotification