gpt4 book ai didi

ios - 设置了RepeatInterval的UILocalNotification每周不触发NSWeekdayCalendarUnit

转载 作者:行者123 更新时间:2023-12-01 17:51:18 25 4
gpt4 key购买 nike

我正在尝试设置本地通知以每周重复一次。
这是我的设置:

UILocalNotification* localNotification =  [[UILocalNotification alloc] init];
...
localNotification.repeatInterval = NSWeekdayCalendarUnit;

在控制台日志中:

localNotif:{开火日期= 2015年4月24日星期五,新加坡标准时间,时区=亚洲/新加坡(GMT + 8)偏移量28800,重复间隔= NSWeekdayCalendarUnit,重复计数= UILocalNotificationInfiniteRepeatCount,下一个射击日期=新加坡标准时间2015年4月25日,星期六,12:27:33 PM,用户信息= {
KUserLocalNotficationKey =“2015-04-24 04:27:33 +0000”;
}}

如您所见,下一个触发日期是第二天触发。这是一个错误吗?
我已经在iOS 7.1、8.1、8.3中对其进行了测试。

最佳答案

PLz试试这个

  UILocalNotification *localNotif=[[UILocalNotification alloc]init];
localNotif.fireDate =currentDate;
localNotif.timeZone=[NSTimeZone defaultTimeZone];
localNotif.alertBody = @"MazeRoll";
localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.applicationIconBadgeNumber = 1;
localNotif.repeatInterval=NSWeekCalendarUnit;
UIApplication *app=[UIApplication sharedApplication];
[app scheduleLocalNotification:localNotif];
NSLog(@"sdfsdfsdf%@",[[UIApplication sharedApplication] scheduledLocalNotifications]);

关于ios - 设置了RepeatInterval的UILocalNotification每周不触发NSWeekdayCalendarUnit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29838839/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com