[英]iOS 5 “Notification Center” API?
我在谈论这个: http : //reviews.cnet.com/8301-19512_7-20120625-233/ios-5-notifications-a-deeper-look/
iOS上的那些下拉菜单,我对生活的热爱找不到任何关于如何发出通知的文档,以便在另一个应用程序中显示更新。 我不知道我是在使用错误的术语还是什么,但是它是“NSNotificationCenter”,它的文档在哪里?
谢谢 :)
数字徽章不是本地通知的唯一属性。 它还可以显示横幅和播放声音。 随后将这些横幅添加到通知中心。
这是一个例子:
- (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/
请参阅apple的Local and Push Notification Programming Guide :
事实上, NSNotificationCenter
不相关,并提供API以在应用程序本身内部传递通知。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.