looping through an NSMutableDictionary

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

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

6条回答
  •  时光说笑
    2021-01-30 08:47

    You don't need to assign value to a variable. You can access it directly with myDict[key].

        for(id key in myDict) {
            NSLog(@"Key:%@ Value:%@", key, myDict[key]);
        }
    

提交回复
热议问题