FROM : André Pang
DATE : Sun Jan 06 04:10:18 2008
On 06/01/2008, at 12:53 PM, Bill Bumgarner wrote:
> Which, unfortunately, is the alternative. There is an enhancement
> request already to offer a mutablecopy keyword.
Is there actually a use for a 'mutablecopy' keyword? I ran into the
same problem as Jonathan, but then realised that retain semantics are
typically what you want for a mutable object. I can't quite think of
a case where a mutable copy of the array in the class would actually
be useful.
(Maybe that thought can be used as a possible warning: if you define a
property for a type that obeys the NSMutableCopying protocol, perhaps
a warning can be emitted if you use copy rather than retain...)
--
% Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>
DATE : Sun Jan 06 04:10:18 2008
On 06/01/2008, at 12:53 PM, Bill Bumgarner wrote:
> Which, unfortunately, is the alternative. There is an enhancement
> request already to offer a mutablecopy keyword.
Is there actually a use for a 'mutablecopy' keyword? I ran into the
same problem as Jonathan, but then realised that retain semantics are
typically what you want for a mutable object. I can't quite think of
a case where a mutable copy of the array in the class would actually
be useful.
(Maybe that thought can be used as a possible warning: if you define a
property for a type that obeys the NSMutableCopying protocol, perhaps
a warning can be emitted if you use copy rather than retain...)
--
% Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>






Cocoa mail archive

