Re: saving an object reference
Re: saving an object reference
- Subject: Re: saving an object reference
- From: Mike Abdullah <email@hidden>
- Date: Thu, 27 Dec 2007 18:42:34 +0000
I would suggest you read up on NSCoder. It provides a more
sophisticated environment than archiving a dictionary.
Mike.
On 27 Dec 2007, at 18:28, James Maxwell wrote:
I'm trying to work out how to save an object which references
another type of object. Basically, I have one object, objectA, which
uses a subclass of itself, objectB, to get information about its
position on the page. So objectA always holds a reference to a
given objectB instance, and figures out its position based on that
instance. This is a recent addition, and it seems to have broken
saving and undo in my app, which is basically because I've no idea
how to save an object reference...
The system used for saving is just to put all of the 'vital
statistics' of my objectA (and objectB, as well, since it's just a
subclass) into an NSMutableDictionary, then write the dict to disk.
Reading then just reads/parses the dict and re-builds the original
objectA.
But how do I store a reference (pointer) to an existing object in a
dictionary?
J.
_______________________________________________
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
_______________________________________________
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