核心數據搜索我有一個核心數據對象Contact
通過字
Contact
=======
fullName
我使用的是NSFetchedResultsController
顯示的聯繫人列表。
現在我想補充一點,表現爲如下的搜索選項:
如果字符串「DA」用戶搜索,結果應該是:
亞倫大衛
貝爾·丹尼爾斯
達納
John David
所以搜索結果是字母排序字符串具有字開始「DA」
我記得看演示如何創建一個Word對象和獨立存儲每個字WWDC會議,但我試圖避免使用此方法。
所以我的問題是,我可以用我目前的模型結構和一些謂詞魔術做這樣的搜索,或者我必須將fullName作爲單獨的詞存儲?
什麼是filterPredicate? – Eyal
它是我的一般主濾鏡。在我的情況:NSPredicate * filterPredicate = [NSPredicate predicateWithFormat:@「deletedServer ==%@」,[NSNumber numberWithBool:NO]];您不必使用它,只需創建一個空謂詞。 –
但你打破搜索字符串的話,我不需要做它我需要找到結果的話 – Eyal