4

I've been cracking my head on this one for weeks now.

What happens if I set the repeatInterval property of a UILocalNotification to be a non-fixed interval? (by non-fixed I mean units such as NSWeekdayCalendarUnit and NSWeekdayOrdinalCalendarUnit).

So say I have UILocalNotification with its fireDate set to the Wednesday in the current week, and I set the repeatInterval to be NSWeekdayCalendarUnit. Will it repeat every Wednesday?

Is the same true for NSWeekdayOrdinalCalendarUnit? So if I have a notification with the fireDate set to be the 4th Wednesday of the month, and I set the repeatInterval to be NSWeekdayOrdinalCalendarUnit, will it repeat every 4th Wednesday of every month?

Thank you in advance.

arturovm
  • 1,215
  • 2
  • 12
  • 28
  • That sounds reasonable. Have you tried it? – Dave DeLong May 13 '11 at 03:20
  • I just tried the NSWeekdayCalendarUnit repeatInteval and it doesn't work like it should, instead of repeating the same day of the following week, it got repeated on Friday of the same week. I'll have to wait a month before being able to test the other one (or I could just change my iPod's date). – arturovm May 13 '11 at 14:04

1 Answers1

3

OK, for the benefit of everyone, here's what I found:

  • Setting the repeat interval to NSWeekdayCalendarUnit doesn't work how I expected, instead, I suppose it looks for every occurrence of that weekday inside a week, and because there is only one, it then schedules the notification for the end of that week (the default is Saturday)

  • In a similar way, setting it to NSWeekdayOrdinalCalendarUnit creates a similar behavior, in that, seeing that there is no more occurrences of X ordinal of X day, it resorts to scheduling to the las ordinal for that weekday in a month.

arturovm
  • 1,215
  • 2
  • 12
  • 28