开发者

UILocalNotification fireDate Q

I've made a LocalNotification app and all is working fine, after setting up the fireDate for dateComponents, however, when i pub the, tableview like this :

NSArray *reminderArray = [[UIApplication sharedApplication] scheduledLocalNotifications]开发者_Python百科;
UILocalNotification *notif = [reminderArray objectAtIndex:indexPath.row];


[cell.textLabel setText:notif.alertBody];
[cell.detailTextLabel setText:[notif.fireDate description ]]; 

the detailtextlabel is 1 hour earlier the the time picked, i cant find the problem, the reminder fires at the right time.

hope u can help me out ....

Thanks Skov


Don't use [notif.fireDate description] to display a date in the UI. Apple may change the format how NSDate describes itself at any time. Currently, it displays itself in GMT but not even that is certain.

Use an NSDateFormatter to display a date on screen.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜