简体   繁体   English

iOS8中不推荐使用kCFCalendarUnitWeek

[英]kCFCalendarUnitWeek deprecated in iOS8

I had a local notification and I set repeatInterval like this 我有一个本地通知,并像这样设置repeatInterval

notification.repeatInterval = kCFCalendarUnitWeek;

but now kCFCalendarUnitWeek is deprecated. 但现在不建议使用kCFCalendarUnitWeek

What can I use instead of this constant. 我可以用什么代替这个常数。

Thanks a lot.. 非常感谢..

Use NSCalendarUnitWeekOfYear with the repeatInterval of your UILocalNotification . NSCalendarUnitWeekOfYearNSCalendarUnitWeekOfYearrepeatInterval UILocalNotification If you had used the NSWeekCalendarUnit , it would have informed you to use either NSCalendarUnitWeekOfYear or NSCalendarUnitWeekOfMonth , and in this case you want to use the former. 如果您使用过NSWeekCalendarUnit ,它将通知您使用NSCalendarUnitWeekOfYearNSCalendarUnitWeekOfMonth ,在这种情况下,您想使用前者。

See https://stackoverflow.com/a/25555560/1271826 . 参见https://stackoverflow.com/a/25555560/1271826

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM