• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSCopying is manual labor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSCopying is manual labor
      • From: "M. Uli Kusterer" <email@hidden>
    • Re: NSCopying is manual labor
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Queue of NSStrings
  • Next by Date: Moderator: EOT (Re: Copyrighting Application Name)
  • Previous by thread: Re: Queue of NSStrings
  • Next by thread: Re: NSCopying is manual labor
  • Index(es):
    • Date
    • Thread