我有一個我的對象的實例數組 - MyObject
。每個實例具有一個字符串和一個數組屬性 - myArrayProperty
包含另一個類的實例 - MyOtherObject
我正在使用NSPredicate
基於在myArrayProperty
的值作爲這樣做一些過濾:NSPredicate檢查數組中的所有項目
NSPredicate *myPredicate = [NSPredicate predicateWithFormat:@"myArrayProperty.otherObjectProperty MATCHES %@", mySearchString];
在這種情況下otherObject屬性是MyOtherObject的字符串屬性。我懷疑是這個結構的問題:myArrayProperty.otherObjectPropert
我的問題是,我如何指示謂詞遍歷myArrayProperty中的所有項目?我想避免在這裏使用for循環。謝謝。
輝煌!這樣可行!謝謝! –
不用擔心,樂於幫忙。 – Fogmeister