2012-07-23 83 views
1

我想寫類似許多一對多字符串比較

[NSPredicate predicateWithFormat:@"ANY manyNames in %@", allNames]; 

而是一個謂語「在」我需要「像」

[NSPredicate predicateWithFormat:@"ANY manyNames like %@", allNames]; 

這將導致一個錯誤。

所以我想用許多名稱的對象獲得結果,這些對象與所有名稱中的至少一個類似。

+0

這有一個'like'示例https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Predicates/Articles/pCreating.html – Almo 2012-07-23 20:38:30

回答

0

我解決了我的問題,通過加入字符串並製作一個字符串,然後查找。