1、快速枚举
//快速遍历
for (id key in mutableDic) //这里怎么解释呢???
{
NSString *object=[mutableDic objectForKey:key];
NSLog(@"%@",object);
}
2、迭代器枚举
//枚举器
NSEnumerator *enumerator1= [mutableDic keyEnumerator];
id key=[enumerator1 nextObject];
while (key) {
id object=[mutableDic objectForKey:key];
NSLog(@"%@",object);
key=[enumerator1 nextObject];
}//对于枚举器,是怎么回事呢?
求大神指教..... |