2011-04-17 53 views
1
UILocalNotification *localNotif = [[UILocalNotification alloc] init]; 
if (localNotif == nil) 
    return; 

localNotif.fireDate = selected; 
localNotif.timeZone = [NSTimeZone defaultTimeZone]; 
localNotif.repeatCalendar = [NSCalendar currentCalendar]; 

if (isSun) { 
    [components setWeekday:1]; 
    [localNotif setRepeatInterval:(NSInteger)components]; 
} 

if (isMon) { 
    [components setWeekday:2]; 
    [localNotif setRepeatInterval:(NSInteger)components]; 
} 

if (isTue) { 
    [components setWeekday:3]; 
    [localNotif setRepeatInterval:(NSInteger)components]; 
} 

if (isWed) { 
    [components setWeekday:4]; 
    [localNotif setRepeatInterval:NSWeekCalendarUnit]; 
} 

if (isThu) { 
    [components setWeekday:5]; 
    [localNotif setRepeatInterval:(NSInteger)components]; 
} 

if (isFri) { 
    [components setWeekday:6]; 
    [localNotif setRepeatInterval:(NSInteger)components]; 
} 

if (isSat) { 
    [components setWeekday:7]; 
    [localNotif setRepeatInterval:(NSInteger)components]; 
} 

我想在選定日期設置鬧鐘,並請更正我的代碼,我是iphone新手。 幫助我。如何在特定日期設置鬧鐘並每週重複計劃

+0

具有u與設置在特定days.i報警做,我也抽上它。但是我完全糊塗了。可ü幫助我怎麼做。謝謝。 – Rani 2011-09-26 08:49:30

回答

2

請參閱從蘋果iOS開發者庫此示例:

Scheduling, Registering, and Handling Notifications

+0

我如何重新安排每週重複。 – 2011-04-18 07:14:22

+0

@Rahul Salvikar:當警報準備好時你不打算通知用戶嗎?那麼您將收到UILocalNotification meesage,並在下週的背景中重新設置鬧鐘。 – 2011-04-18 08:28:59

+0

謝謝我的問題解決了 – 2011-04-18 15:03:27

相關問題