【发布时间】:2014-05-27 15:36:26
【问题描述】:
我无法触发UILocalNotification
我有一个 1 到 30 的用户输入,我想用它来为UILocalNotification 设置为firedate。
例如,用户选择了 5。我想在当前日期后 5 天设置其 firedate。你是怎么计算的?
谢谢。
这是我到目前为止所做的......使用它只需要几秒钟......
notification.fireDate = [[NSDate date] dateByAddingTimeInterval:self.daysBeforeNotification];
【问题讨论】:
-
你有没有研究或尝试过什么?
-
显示您的尝试,以便我们帮助您找到问题。
-
查看:
-[NSCalendar dateByAddingComponents] -
嗨@SimonMcLoughlin,我只尝试过
notification.fireDate = [[NSDate date] dateByAddingTimeInterval:self.daysBeforeNotification];,但它只持续了几秒钟.. -
@pretty_pau .... 你告诉我你不知道如何在几秒钟内通过 x 天????
标签: ios objective-c uilocalnotification