2013-03-29 92 views

回答

5

当你的应用程序在后台时使用UILocalNotification

UILocalNotification *notification = [[UILocalNotification alloc] init]; 
notification.alertBody = @"Your message"; 
notification.alertAction = @"Open app"; 
[[UIApplication sharedApplication] presentLocalNotificationNow:notification]; 
+0

把这些代码行放在哪里?我的意思是在哪种方法? –

+0

我怎么知道?这是你的项目,不是我的。 – DrummerB

+0

谢谢DrummerB。但我只想显示警报。不是本地通知。可能吗。请分享你对此的看法。等待回复。 –

相关问题