Hi,
I have a class
@interface Ray : NSObject {
...
NSBezierPath *path;
...
}
@property (copy) NSBezierPath *path;
@end
an instance of which is accessed in another class:
- (void)drawRect:(NSRect)rect
{
NSBezierPath *temporaryPathPointerWhichIsSupposedToBeDifferent;
...
temporaryPathPointerWhichIsSupposedToBeDifferent = [ray.path];
[temporaryPathPointerWhichIsSupposedToBeDifferent
transformUsingAffineTransform: aVeryLongDescriptiveTransformName];
[temporaryPathPointerWhichIsSupposedToBeDifferent stroke];
...
}
I thought the (copy) attribute would mean that
temporaryPathPointerWhichIsSupposedToBeDifferent would be, well, a
copy of the original path instance (which conforms to the NSCopying
protocol). Of course, the compiler doesn't care what *I* think should
happen, and applies the transform to path (which is identical to
temporaryPathPointerWhichIsSupposedToBeDifferent).
It works if I do:
temporaryPathPointerWhichIsSupposedToBeDifferent = [ray.path copy];
instead.
Why isn't it doing what I think it should do though?
Thanks,
colin
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com