我正在尝试从已设置的通知中获取 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;
}
locNotification 具有值,但当我尝试实例化我得到的 otherDate 时的最后一行
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM fireDate]: unrecognized selector sent to instance 0x1e4e20'
*在第一次抛出时调用堆栈:
我真的不知道我做错了什么。
提前致谢