以下のコードですが、通知が出た後、アイコンバッジをキャンセルできません。アプリケーションを起動し、通知をキャンセルし、アイコン バッジをリセットするには、どのコードを追加すればよいですか?
別の質問は、通知が電話のホーム画面にのみ表示されるのはなぜですか? アプリケーション内では、通知は表示されません。ありがとう。
display.text=[NSString stringWithFormat:@"%@A",display.text];
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Utilities" message:@"Alarm added" delegate:self cancelButtonTitle:@"Done" otherButtonTitles:nil];
    // optional - add more buttons:
    [alert show];
    UILocalNotification *localNotification = [[UILocalNotification alloc] init]; //Create the localNotification object
    NSDate *date = [NSDate date];
    // Add one minute to the current time
    NSDate *dateToFire = [date dateByAddingTimeInterval:20];
    // Set the fire date/time
    [localNotification setFireDate:dateToFire];
    [localNotification setTimeZone:[NSTimeZone defaultTimeZone]];
    [localNotification setAlertAction:@"Done"]; 
    [localNotification setAlertBody:@"(A)"]; 
    [localNotification setHasAction: YES]; 
    [localNotification setSoundName:UILocalNotificationDefaultSoundName];
    [localNotification setApplicationIconBadgeNumber:[[UIApplication sharedApplication] applicationIconBadgeNumber]+1]; 
    [[UIApplication sharedApplication] scheduleLocalNotification:localNotification];