的數組我有以下情況:NSPredicate的陣列
NSArray(
NSArray(
string1,
string2,
string3,
string4
)
,
NSArray(
string1,
string2,
string3,
string4
)
)
我需要的是它返回一個包含從objectAtIndex特定字符串數組謂詞:0這是關係到字符串1。我應該找回整個數組,因爲我需要處理該數組內的其他字符串。可能嗎?
什麼,我嘗試了,現在要做的是以下幾點:
NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:@"ANY SELF contains[cd] %@",searchText];
searchData = [myArray filteredArrayUsingPredicate:resultPredicate];
NSLog(@"array %@",searchData);`
我的問題是,當任何字符串1,字符串,STRING3的,串,4包含SEARCHTEXT和我的代碼將返回數組不僅STRING1和無論如何我無法實現我的目標!
我不明白您的要求,您能否詳細說明呢?如果searchText會「str」,那麼你想得到什麼? – iPatel
你能告訴你想要什麼樣的輸出嗎?一個規範化的數組或什麼? –