我想複製一個NSMUtableDictionary值到另一個NSMutableDictioary。我怎樣才能做到這一點?如何將iPhone中的NSMutableDictionary值複製到另一個NSMutableDictionary中?
這裏我的代碼,
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.
}
我想訪問tempDictionary值Person類。所以我如何從feedDictionary複製到tempDictionary。請幫助我。
謝謝。