ローカル通知のプロパティは、数字のバッジだけではありません。また、バナーを表示したり、サウンドを再生したりすることもできます。これらのバナーは、その後通知センターに追加されます。
次に例を示します。
- (void)addNotification {
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = self.datePicker.date;
localNotification.alertBody = self.messageField.text;
localNotification.soundName = UILocalNotificationDefaultSoundName;
localNotification.applicationIconBadgeNumber = 1;
NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:@"Object 1", @"Key 1", @"Object 2", @"Key 2", nil];
localNotification.userInfo = infoDict;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
[localNotification release];
}
そしてここにチュートリアルがあります:http ://www.icodeblog.com/2010/07/29/iphone-programming-tutorial-local-notifications/