-2
如果不改變這一天,一切正常工作與下面的代碼。但是,當改變的日子把徽章2,而不是把1。UILocalNotification applicationIconBadgeNumber每天不工作
你知道爲什麼會發生這種情況嗎?
UILocalNotification* localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = startDate;
localNotification.soundName = UILocalNotificationDefaultSoundName;
localNotification.alertBody = [NSString stringWithFormat:@"%@ '%@'.", NSLocalizedString (@"Tiene tareas pendientes para realizar en su acuario", ""), descripcionAcuario];
localNotification.alertAction = descripcionTextField.text;
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.applicationIconBadgeNumber = [[UIApplication sharedApplication] applicationIconBadgeNumber] + 1;
NSDictionary *inventory = @{
@"AcuarioID" : [NSNumber numberWithInt: acuarioSeleccionadoID],
@"TareaID" : [NSNumber numberWithInt: tareaSeleccionada],
};
localNotification.userInfo= inventory;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
什麼是你的問題,你有什麼? –
代碼在哪裏? –
對不起,這裏是代碼 – Shadros