[英]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.