【发布时间】:2013-04-10 02:31:40
【问题描述】:
我想每周晚上 10 点(不限国家/地区)发出通知。我需要使用时区吗?目前我正在使用下面的代码每周触发通知,但是如何在晚上 10 点准确触发通知。
NSDate *date = [NSDate date];
NSDate* myNewDate = [date dateByAddingTimeInterval:7*24*60*60];
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = myNewDate;
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.repeatInterval = NSWeekCalendarUnit;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
[localNotification release];
【问题讨论】:
标签: iphone notifications