`
zani
  • 浏览: 350360 次
  • 性别: Icon_minigender_1
  • 来自: 福州
社区版块
存档分类
最新评论

NSDictionary遍历所有的key和Values

 
阅读更多

NSEnumerator *enumerator = [theSelectedRowDict objectEnumerator];
			id key;
			
			while ((key = [enumerator nextObject])) 
			{
				DLog(@">>>>>>>>>@@@>>>%@", key);
				/* code that uses the returned key */
			}

 

 

遍历key:

NSEnumerator *enumerator = [theSelectedRowDict keyEnumerator];
			id key;
			
			while ((key = [enumerator nextObject])) 
			{
				DLog(@">>>>>>>>>@@@>>>%@", key);
				/* code that uses the returned key */
			}
 
分享到:
评论
1 楼 zhaoyubetter 2012-07-30  
不对啊。这是遍历 value啊

相关推荐

Global site tag (gtag.js) - Google Analytics