开发者

UILocalNotification - Fire 30 minutes before an NSDate

开发者 https://www.devze.com 2023-03-18 02:21 出处:网络
I am making an app that will fire a notification 30 minutes b开发者_开发百科efore an event. I calculate the NSDate and set the notification with this huge code: http://pastie.org/private/3n9z6c06i17i8

I am making an app that will fire a notification 30 minutes b开发者_开发百科efore an event. I calculate the NSDate and set the notification with this huge code: http://pastie.org/private/3n9z6c06i17i8h8giing

However, the notification never fires. Could anyone please help me?


I see that you've set the notification.fireDate as:
[notification setFireDate:[NSDate dateWithTimeIntervalSinceNow:[remain second]]];

But, your notification.timeZone doesn't appear to be set, so you're relying on the default?

Even though, you have:
[parser setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:14400]];

Try using this instead:
notification.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:14400];

0

精彩评论

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