有人可以幫助我如何通過下面的數據進行判斷並檢索鍵「文本」的值。起初,我有以下數據使用字典鍵通過嵌套數組NSPredicate
{
ArrayName1 = (
{
Target = "<null>";
Text = "Name1";
Value = 1;
},
{
Target = "<null>";
Text = "Name2";
Value = 2;
}
);
ArrayName2 = (
{
Target = "<null>";
Text = "Name3";
Value = 3;
},
{
Target = "<null>";
Text = "Name4";
Value = 4;
}
);
ArrayName3 = (
{
Target = "<null>";
Text = "Name5";
Value = 5;
},
{
Target = "<null>";
Text = "Name6";
Value = 6;
}
);
ArrayName4 = (
{
Target = "<null>";
Text = "somename";
Value = somevalue;
}
);
ArrayName4 = (
{
Target = "<null>";
Text = "somename";
Value = "somevalue";
}
);
}
我想最終的結果將被存儲在「resultarray」這應該由搜索字符串從所有的陣列包含的「文本」的鍵值字典,也想存儲相同數組中「Value」鍵的相應值。
感謝, 普拉迪普
顯示你有嘗試過嗎?並且可以請你在搜索結束後舉例說明你想要的內容嗎? –
發佈你到目前爲止嘗試過的代碼..? – remyr3my
@ Dev.RK,請查看下面我試過的方法。 – user3310076