开发者

UILocalNotification fireDate Q

开发者 https://www.devze.com 2023-02-05 03:59 出处:网络
I\'ve made aLocalNotification app and all is working fine, after setting up the fireDate for dateComponents, however,when i pub the, tableview like this :

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

精彩评论

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