Can any one please tell me how to set notifications for different values at different time..
Suppose i have an array of size 4,
For example an array a={1,2,3};
What i want is after every hour it will show the notification for different array values;
For first time,it will show “1”,then “2” after one hour and then “3” for third hour.
The code which i have implemented is for only one value which is shown below…
NSDate *fireDate = [NSDate date];
NSArray *values= [NSArray arrayWithObjects:@"1", @"2", @"3", nil];
for (NSString *string in values )
{
// create notification...
localNotify.fireDate =[NSDate dateWithTimeIntervalSinceNow:[datePicker countDownDuration]];
localNotify.alertBody = string;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotify];
fireDate = [fireDate dateByAddingTimeInterval:67];
[localNotify setApplicationIconBadgeNumber:[[UIApplication sharedApplication] applicationIconBadgeNumber]+1];
NSLog(@"1");
}
Just use a loop, e.g.: