Re: Confusion with copyWithZone and Archiving
Re: Confusion with copyWithZone and Archiving
- Subject: Re: Confusion with copyWithZone and Archiving
- From: Doug Hill <email@hidden>
- Date: Mon, 29 Feb 2016 08:05:47 -0800
From the NSCopying protocol reference:
If a subclass inherits NSCopying from its superclass and declares additional instance variables, the subclass has to override copyWithZone: to properly handle its own instance variables, invoking the superclass’s implementation first.
There are many other good tidbits of info in there, check it out and hopefully it will cover what you want to know.
Doug Hill
> On Feb 29, 2016, at 6:58 AM, Dave <email@hidden> wrote:
>
> Hi,
>
> I have an inheritance chain Classes that are NSCoding and NSCopying compliant like so:
>
>
> @interface LTWBaseClass : NSView <NSCoding,NSCopying>
>
> @interface LTWSubclassA : LTWBaseClass <NSCoding,NSCopying>
>
> @interface LTWSubclassB : LTWSubclassA <NSCoding,NSCopying>
>
> Each of these three classes contain properties that need to be archived and unarchived. In initWithCoder and encodeWithCoder methods I call [super initWithCoder] and [super encodeWithCoder], but I’m not sure what to do for copyWithZone? Do I need to call the super version of this method too?
>
> Thanks a lot, All the Best
> Dave
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden