AppDelegate.m
警報在UILocalNotification是沒有得到所謂的
- (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
顯示警報獲取調用,但警報方法沒有被調用。
什麼是在 - (void)showReminderAlert:(NSString *)文本中的文字?它根本沒用過 – 2013-02-20 07:21:58
- (void)showReminderAlert:(NSString *)text中有什麼用法?它根本沒有使用 – 2013-02-20 07:23:08