在一個CSSearchableItem的init中,其中一個參數是蘋果在其文檔中寫入的「domainIdentifier」是該項目的「關聯ID」。這是什麼?iOS 9 - 「domainIdentifier」for CSSearchableItem
0
A
回答
3
domainIdentifier是一種方式組幾個可搜索的項目在一起。 您將在需要時使用它來恢復/更新/刪除項目組。
1
域標識符是要編入索引的組名。 例如,如果你指數從使用應用的所有聯繫人可以使用類似如下:
searchableItems=[[CSSearchableItem alloc]initWithUniqueIdentifier:identifier domainIdentifier:@"contacts" attributeSet:attributeSet];
的域標識符名稱用於輕鬆地刪除這樣的域中的所有指標:
[[CSSearchableIndex defaultSearchableIndex]deleteSearchableItemsWithDomainIdentifiers:@[@"contacts"] completionHandler:^(NSError * __nullable error) {
if (error!=nil)
{
NSLog(@"%@",error.description);
}
else
{
// Indexes deleted successfully
}
}];
+0
但這沒有任何意義,那麼'''deleteAllSearchableItemsWithCompletionHandler'''方法的重點是什麼呢?那不需要任何標識符? – Supertecnoboff
相關問題
- 1. iOS 9中的Core Spotlight CSSearchableIndex中的項目數量(CSSearchableItem)是否有限制?
- 2. UIAlertView for iOS 9的替代方案?
- 3. iOS 9 NSUserActivity for search does not update it's thumbnail
- 4. ios 9核心聚光燈搜索不適用於某些字符串CSSearchableItemAttributeSet
- 5. Backbone.js BasicAuth for IE 9
- 6. 的iOS 9:edgesForExtendedLayout
- 7. ios 9 + Xcode 7
- 8. 在iOS 9
- 9. preferredLanguages的iOS 9
- 10. iOS 9 UIInputViewController dismissKeyboard
- 11. iOS中8和iOS 9
- 12. 解析FacebookUtils for iOS 9失敗,發生-canOpenURL錯誤
- 13. -canOpenURL:URL失敗:「fbauth2:/」 - 錯誤:「(null)」for ios 9(swift)
- 14. RegEx review for ^([2-8])(\。[0-9] {1,3})?|(^ [9])(\。[0-9] {1,1})?$
- 15. iOS 9 Compatiblity問題
- 16. iOS 9 Swift 2.0 UITextFieldDidChange
- 17. iOS 9/10 NavigationController Difference
- 18. UITabBarItem - 在iOS版9
- 19. KeychainTouchID iOS 8和9
- 20. ReloadSections崩潰:iOS 9
- 21. 如何在IOS 9
- 22. 登錄Facebook之前iOS 9
- 23. iOS 9在iOS 9中旋轉後,UINavigation欄內容不居中?
- 24. 的Facebook SDK 4.5 IOS 9
- 25. IOS編碼ISO-8859-9
- 26. iOS 9 Facebook SDK解析
- 27. CGBitmapContextCreate停止針對iOS 9
- 28. didRegisterForRemoteNotificationsWithDeviceToken沒有在IOS 9
- 29. 轉換MPMediaItemArtwork從iOS的10到iOS 9
- 30. addSubview - iOS設備8 VS iOS版9
你說「刪除項目組」 - 你的意思是什麼?你的意思是刪除應用程序的所有索引項目或刪除應用程序的索引數據的一部分?因爲否則,'''''''''''不需要任何標識符的deleteAllSearchableItemsWithCompletionHandler'''方法的重點是什麼? – Supertecnoboff