开发者

Creating an alarm, for five different time in daily basis for iPhone App

How to create an alarm for开发者_运维问答 five different time in daily basis for the year for iPhone App ? the five different time in daily basis are scheduled


Use local notification.

Create 5 different local notification and set the repeat unit as daily

Refer apple documentation.


You need to set the notification.repeatInterval

like following

NSInteger index = [scheduleControl selectedSegmentIndex];
     switch (index) {
    case 1:
        notif.repeatInterval = NSMinuteCalendarUnit;
        break;
    case 2:
        notif.repeatInterval = NSHourCalendarUnit;
        break;
    case 3:
        notif.repeatInterval = NSDayCalendarUnit;
        break;
    case 4:
        notif.repeatInterval = NSWeekCalendarUnit;
        break;
    default:
        notif.repeatInterval = 0;
        break;
}

This will help you http://useyourloaf.com/blog/2010/9/13/repeating-an-ios-local-notification.html Thanks, Naveed

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜