У меня есть 6 UILocalNotifications. Каждое уведомление имеет свой собственный "USERINFO"Как я могу изменить UserInfo в UILocalNotification?
- @ "1"
- @ "2"
- @ "3"
- @ "4"
- @ "5"
- @ "6"
Затем я удаляю номер уведомления 4 и получаю 5 уведомлений:
- @ "1"
- @ "2"
- @ "3"
- @ "5"
- @ "6"
Как я могу изменить " userInfo " в уведомлениях на получение:
- @" 1 "
- @ "2"
- @ "3"
- @ "4"
- @ "5"
Сохранить код -
// Specify custom data for the notification
NSDictionary *infoDict = [NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"%i", i] forKey:@"notif"];
localNotif.userInfo = infoDict;
i = i + 1;
Del код -
if (flagTable == 1)
{
int numberPhoto = [[[UIApplication sharedApplication] scheduledLocalNotifications] count];
int numPhFlag = numberPhoto;
int i = 0;
NSLog(@"Col notif = %d", numberPhoto);
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
while (numberPhoto == numPhFlag) {
localNotif = [[[UIApplication sharedApplication] scheduledLocalNotifications] objectAtIndex:i];
localNotif.timeZone = [NSTimeZone localTimeZone];
NSDateFormatter *format = [[NSDateFormatter alloc] init];
[format setDateFormat:@"dd-MM-yyyy HH:mm"];
NSString *itemDateWithFormat = [format stringFromDate:localNotif.fireDate];
NSLog(@"remText2 %@ = fireDate2 %@", itemDateWithFormat, [appDel.fireDateArray objectAtIndex:row]);
if ([itemDateWithFormat isEqualToString:[appDel.fireDateArray objectAtIndex:row]]) {
NSLog(@"remText3 %@ = fireDate3 %@", itemDateWithFormat, [appDel.fireDateArray objectAtIndex:row]);
[[UIApplication sharedApplication] cancelLocalNotification:localNotif];
numPhFlag = numPhFlag - 1;
}
i = i + 1;
}
int getNot = [[[UIApplication sharedApplication] scheduledLocalNotifications] count];
NSLog(@"Col notif2 = %d", getNot);
}
Я хочу повторить над уведомлениями и заменить данные в своей пользовательской информации.
показать нам свои коды. – Raptor