को सूचित करता है, इसलिए मैं मूल रूप से एक ऐप सेट करने की कोशिश कर रहा हूं जो स्थानीय नोटिफिकेशन को लगातार देता है।मैं UILocalNotification कैसे बना सकता हूं जो हर दो मिनट
अब तक मेरे पास है:
- (void)scheduleNotification {
[reminderText resignFirstResponder];
[[UIApplication sharedApplication] cancelAllLocalNotifications];
Class cls = NSClassFromString(@"UILocalNotification");
if (cls != nil) {
UILocalNotification *notif = [[cls alloc] init];
notif.fireDate = [datePicker date];
notif.timeZone = [NSTimeZone defaultTimeZone];
notif.alertBody = @"Your building is ready!";
notif.alertAction = @"View";
notif.soundName = UILocalNotificationDefaultSoundName;
notif.applicationIconBadgeNumber = 1;
NSInteger index = [scheduleControl selectedSegmentIndex];
switch (index) {
case 1:
notif.repeatInterval = NSMinuteCalendarUnit;
break;
case 2:
notif.repeatInterval = NSMinuteCalendarUnit*2;
break;
default:
notif.repeatInterval = 0;
break;
}
NSDictionary *userDict = [NSDictionary dictionaryWithObject:reminderText.text
forKey:kRemindMeNotificationDataKey];
notif.userInfo = userDict;
[[UIApplication sharedApplication] scheduleLocalNotification:notif];
[notif release];
}
}
मैं तो मैं एक अधिसूचना हर 2 मिनट प्राप्त कर सकते हैं और हर 1 मिनट (जब मैं मामला 2 सेट) इसे बनाने के लिए कोशिश कर रहा हूँ (जब मैं मामले 1 सेट) सूचित किया जाना। एकमात्र समस्या यह है कि * 2 2 हर 2 मिनट में अधिसूचित होने के लिए काम नहीं कर रहा है। मैं इसे बनाने के बारे में कैसे जाउंगा ताकि यह हर 2 मिनट को सूचित करे?