Yes, the behavior is correct.
You are probably confused by the difference between copy
and mutableCopy
.
copy
returns the object returned by copyWithZone:
. That in turn will return an immutable variant if the class has both an immutable and an mutable variant.
See the discussion in the documentation for copyWithZone:
:
The copy returned is immutable if the consideration “immutable vs. mutable” applies to the receiving object; otherwise the exact nature of the copy is determined by the class.