Mob*_*Coe -1 objective-c nsdate nsnotificationcenter ios
如何在12小时后准确设置我的localNotifications防火日期属性?我的代码片段如下,
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
return;
localNotif.fireDate = [NSDate date]; // how to set after 12 hours
localNotif.timeZone = [NSTimeZone defaultTimeZone];
Run Code Online (Sandbox Code Playgroud)
任何建议表示赞赏.
localNotif.fireDate =[[NSDate date] dateByAddingTimeInterval:60*60*12]
Run Code Online (Sandbox Code Playgroud)
时间间隔以秒为单位