In iOS 7.0 the NSWeekCalendarUnit
has been deprecated. The documentation says it has to be replaced:
Use NSCalendarUnitWeekOfMonth or NSCalendarUnitWeekOfYear, depending on which you mean
I am using NSWeekCalendarUnit
for weekly reminders, which one do I have to pick to get the same meaning? I dont understand the difference between NSCalendarUnitWeekOfMonth
and NSCalendarUnitWeekOfYear
.
Someone has asked the same question here on SO, without an convincing answer.
It quite confusing. Next week
is in my understanding atomic. Today is Sun 30 March 2014
. Hence Next week
will always be Sun 6 March 2014
. How could that change from a month or year perspective?
If you were using NSWeekCalendarUnit to trigger a weekly reminder, replace it with NSCalendarUnitWeekOfYear:
if (days == 7) localNotif.repeatInterval = NSWeekCalendarUnit; // deprecated if (days == 7) localNotif.repeatInterval = NSCalendarUnitWeekOfYear;
You should find your weekly notification still works correctly.
Apple's documentation should be updated to provide guidance on the appropriate replacement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With