looping through an NSMutableDictionary

前端 未结 6 1041
野趣味
野趣味 2021-01-30 08:02

How do I loop through all objects in a NSMutableDictionary regardless of the keys?

6条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 08:40

    you can use

    [myDict enumerateKeysAndObjectsUsingBlock: ^(id key, id obj, BOOL *stop) {
        // do something with key and obj
    }];
    

    if your target OS supports blocks.

提交回复
热议问题