辞書の配列が 2 つあり、それらを比較したい
実際の辞書構造はFacebookのインタレストリストのようなもので、以下のようになっています
自分と友達の共通の趣味を知りたい
両方のユーザーの関心リストを取得しましたが、created_time が異なるため、関心の辞書を比較している間、共通の辞書を取得していません。
category = "Musical instrument";
"created_time" = "2011-06-11T09:10:07+0000";
id = 113099055370169;
name = Guitar;
と
category = "Musical instrument";
"created_time" = "2013-09-27T06:02:28+0000";
id = 113099055370169;
name = Guitar;
誰でもこれを行う効率的な方法を提案できますか
今私は使用していますが、created_timeが異なるため、共通の利益を与えていません
for (int count = 0; count < [arrFriendsInterest count]; count++)
{
NSDictionary *dictFriend = [arrFriendsInterest objectAtIndex:count];
if ([arrMyIntrest containsObject:dictFriend]) {
[arrMutualInterest addObject:dictFriend];
}
}
arrFriendsInterest は、友人の関心を含む辞書の配列です。
arrMyIntrest は私の興味を含む辞書の配列です×コメントは 5 分間のみ編集可能です×コメントは 5 分間のみ編集可能です×コメントは 5 分間のみ編集可能です