NSCopying is manual labor
NSCopying is manual labor
- Subject: NSCopying is manual labor
- From: Adam <email@hidden>
- Date: Wed, 30 Mar 2005 05:54:39 -0500
I want to circumvent NSUndoManager for right now and use a copy of an
object. I have a complicated series of actions that manipulate the
state of a model object. Rather then register each one with the
NSUndoManager I just want to make a backup copy of the entire object.
If the user hits undo I will replace the modified object with the back
up copy.
I am just beginning to read about NSCopying, but from what I understand
I have to implement a copyWithZone method in my model class , init a
new object, and by hand copy all 20 instance variables from the current
object into the new object. Then since two of my instance variables are
themselves model objects I need to repeat this process over again for
each class. This is a lot of work. Is there something I am missing that
can just copy an entire object and its contents in its current state,
or am I on the right track to do it manually like this?
Thanks,
Adam
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden