我说的是这样的: http://reviews.cnet.com/8301-19512_7-20120625-233/ios-5-notifications-a-deeper-look/iOS 5“通知中心”API?
那些下拉菜单在iOS上,我对生活的热爱无法找到如何使一个通知的任何文件,使其显示的更新,而在另一个应用程序。我不知道我是否正在使用错误的术语或内容,但它是否是“NSNotificationCenter”,以及它的任何文档在哪里?
谢谢:)
我说的是这样的: http://reviews.cnet.com/8301-19512_7-20120625-233/ios-5-notifications-a-deeper-look/iOS 5“通知中心”API?
那些下拉菜单在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/
非常感谢! :) –
指Local and Push Notification Programming Guide苹果:
NSNotificationCenter
其实没有关系,并提供API,以在应用程序本身内部传递的通知。
UILocalNotification? –
NSNotificationCenter是完全不相关的东西。 – 2012-08-30 20:49:34
UILocalNotification通过我的应用程序名称在红色框中放置“1”,不标记横幅... –