开发者

Accessing Dictionary keys programmatically

I have an array and a Dictionary and I would like to run some for loops to see if the elements in the array are equal to each of the keys in the Dictionary.

Is there a way to do this using开发者_开发技巧 objective-c?


NSMutableSet *intersection = [[NSMutableSet alloc] init];
[intersection addObjectsFromArray:array];
[intersection intersectSet:[NSSet setWithArray:[dictionary allKeys]]];

intersection contains a set of the objects that exists both as keys in your dictionary and in your array.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜