AppDelegate.m
- (void)applicationWillEnterForeground:(UIApplication *)application
{
application.applicationIconBadgeNumber = 0;
}
-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
application.applicationIconBadgeNumber = 0;
NSString *reminderText = [notification.userInfo objectForKey:kRemindMeNotificationDataKey];
[self.settings showReminderAlert:reminderText];
NSLog(@"Application REcieved Local Notification");
}
ViewController.m
-(void)showReminderAlert:(NSString *)text{
NSLog(@"Alert Called");
UIAlertView *reminderAlert = [[UIAlertView alloc]initWithTitle:@"Alert" message:text delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[reminderAlert show];
[reminderAlert release];
}
ユーザーが再度入力したときにアプリケーションにアラートを表示させたいのですapplication.app
didReceiveLocalNotification
が、Alert メソッドが呼び出されていません。