Timeline for deep mutable copy of a NSMutableDictionary
Current License: CC BY-SA 3.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 23, 2017 at 12:10 | history | edited | URL Rewriter Bot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
Jan 28, 2014 at 21:10 | history | edited | James Eichele | CC BY-SA 3.0 |
Made it clear that this answer is for specific cases only, and linked to more general solutions
|
Jan 28, 2014 at 20:52 | comment | added | James Eichele | @hfossli: as stated in the question, the NSDictionary contains only arrays of strings, so there is no need to worry about deeper levels. However, I can see that some visitors might not realize that this solution only works in special cases. I will attempt to make it more clear. | |
Jul 19, 2011 at 16:33 | comment | added | James Eichele |
@Krishnabhadra: Yes, you will definitely need to implement NSCopying if you are using custom objects. The original question dealt only with NSArray objects.
|
|
Jul 18, 2011 at 11:29 | comment | added | Krishnabhadra | @e.James do we need to have NSCopying for this function to work? I am getting error -[MyClass copyWithZone:]: unrecognized selector sent to instance | |
S May 9, 2011 at 23:26 | history | suggested | Nik | CC BY-SA 3.0 |
fixed a typo
|
May 9, 2011 at 22:44 | review | Suggested edits | |||
S May 9, 2011 at 23:26 | |||||
May 9, 2011 at 22:44 | comment | added | Nik |
There is also a typo in the middle of for loop - replace setValue:copy with setValue:array
|
|
Dec 23, 2009 at 14:59 | comment | added | James Eichele |
Ah, yes. Sorry! That should definitely have been mutableCopy . I made the change in my answer.
|
|
Dec 23, 2009 at 14:58 | history | edited | James Eichele | CC BY-SA 2.5 |
fixed a bug
|
Dec 23, 2009 at 5:25 | vote | accept | Z S | ||
Dec 23, 2009 at 5:25 | comment | added | Z S | replaced 'copy' with 'mutableCopy' and it's fine. | |
Dec 23, 2009 at 4:54 | comment | added | Z S | Thanks, but the "copy" makes the NSArray (or NSMutableArray) immutable in the new dictionary. So that's not going to work. | |
Dec 23, 2009 at 2:45 | history | edited | James Eichele | CC BY-SA 2.5 |
added some simplified code
|
Dec 23, 2009 at 2:37 | history | answered | James Eichele | CC BY-SA 2.5 |