Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tiltem

macrumors newbie
Original poster
Oct 18, 2010
25
0
I am not clear on how to make a nested array, or dictionary, mutable from a plist. My plist structure is:
Code:
dictionary
   -dictionary
       -array
       - array
   -dictionary
       -array
       - array

I need the arrays to be mutable, but have not been able to figure out how. I have read this can be done with mutableCopy, but am unclear as to how this is done.

Thanks!
 
I need the arrays to be mutable, but have not been able to figure out how.
You need the arrays to be mutable but not the dictionaries containing them? If so, that's not really possible. Because by changing the value of the array, you'd also need the dictionary to be updated (since one of its subvalues has changed).

P.S. To create a mutable copy of a non-mutable object is as simple as, in the case of an NSArray:
Code:
NSMutableArray *mutableArray = [nonmutableArray mutableCopy];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.