[英]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
. 将
NSCalendarUnitWeekOfYear
与NSCalendarUnitWeekOfYear
的repeatInterval
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
,它将通知您使用NSCalendarUnitWeekOfYear
或NSCalendarUnitWeekOfMonth
,在这种情况下,您想使用前者。
See https://stackoverflow.com/a/25555560/1271826 . 参见https://stackoverflow.com/a/25555560/1271826 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.