本文介绍了如何将NSMutableDictionary值复制到iPhone中的另一个NSMutableDictionary中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将NSMUtableDictionary值复制到另一个NSMutableDictioary中.我该怎么办?

I want to copy a NSMUtableDictionary values into the another NSMutableDictioary. How can i do that?

这是我的代码,

 PersonClass.h file:

 NSMutableDictionary *tempDictionary;
 @property (nonatomic, retain) NSMutableDictionary *tempDictionary;

 PersonClass.m
 @synthesize tempDictionary; 

 tempDictionary = [[NSMutableDictionary alloc] init];

-(PersonClass *) initWithPerson:(NSMutableDictionary *) feedDictionary
{
     // get all the values in feedDictionary.

     //Now i want copy of the details from feedDictionary into the tempDictionary

           tempDictionary = feedDictionary; // Doesn't copy.
}

我想访问person类的tempDictionary值.所以我怎么能从feedDictionary复制到tempDictionary.请帮帮我.

I want to access the tempDictionary values to the person class. SO how can i copy from feedDictionary to the tempDictionary. Please help me out.

谢谢.

推荐答案

如何?

tempDictionary = [[NSMutableDictionary alloc]initWithDictionary:feedDictionary];

欢呼

这篇关于如何将NSMutableDictionary值复制到iPhone中的另一个NSMutableDictionary中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 07:11