Possible Duplicate:
What's the best way to use Obj-C 2.0 Properties with mutable objects, such as NSMutableArray?
Please excuse my poor English 🙂
In Objective C, the ‘copy’ qualifier doesn’t retain the mutability. We have to make a property ‘strong’ or provide a setter ourselves.
I just want to know why the ‘mutablecopy’ qualifier is not provided. Any specific reason or design tradeoffs ?
Because making a mutable copy actually has deep and subtle meaning that makes it nontrivial. As well, you pretty much never want an objects internal storage to be externally mutable.
Also, if properties were to support mutable copy, there would need to be a version for the setter and one for the getter as each has a very different potential role (if you really did want a mutable property, you might want a mutable copying setter and normal retain getter. Or the other way around.).
None of this addresses the even nastier issue of deep versus shallow mutable copy.