【问题标题】:UILocalNotification - Fire 30 minutes before an NSDateUILocalNotification - 在 NSDate 前 30 分钟触发
【发布时间】:2011-07-07 06:08:16
【问题描述】:

我正在制作一个会在活动前 30 分钟触发通知的应用。我计算 NSDate 并使用这个巨大的代码设置通知:http://pastie.org/private/3n9z6c06i17i8h8giing

但是,通知永远不会触发。 谁能帮帮我?

【问题讨论】:

    标签: cocoa-touch ios4 nsdate nsdateformatter uilocalnotification


    【解决方案1】:

    我看到您已将 notification.fireDate 设置为:
    [notification setFireDate:[NSDate dateWithTimeIntervalSinceNow:[remain second]]];

    但是,您的 notification.timeZone 似乎没有设置,所以您依赖默认值?

    尽管如此,你有:
    [parser setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:14400]];

    尝试改用这个:
    notification.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:14400];

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-06
      • 2016-09-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多