for each loop in Objective-C for accessing NSMutable dictionary

前端 未结 7 468
忘掉有多难
忘掉有多难 2020-11-30 16:45

I am finding some difficulty in accessing mutable dictionary keys and values in Objective-C.

Suppose I have this:

NSMutableDictionary *xyz=[[NSMutabl         


        
相关标签:
7条回答
  • 2020-11-30 17:20

    The easiest way to enumerate a dictionary is

    for (NSString *key in tDictionary.keyEnumerator) 
    {
        //do something here;
    }
    

    where tDictionary is the NSDictionary or NSMutableDictionary you want to iterate.

    0 讨论(0)
提交回复
热议问题