Re: MVC, storing VIEW-specific information and core data
Re: MVC, storing VIEW-specific information and core data
- Subject: Re: MVC, storing VIEW-specific information and core data
- From: "I. Savant" <email@hidden>
- Date: Mon, 9 Mar 2009 14:52:42 -0400
On Mon, Mar 9, 2009 at 1:49 PM, Karolis Ramanauskas <email@hidden> wrote:
> I have Core Data Document Based app. Core Data
> model contains entities that describe graph objects (nodes).
...
> Of course I should be able to
> drag them around the screen all that stuff. But this is purely user
> interface stuff I don't want the model to change because I drag stuff
> around. What is the best way to store the coordinates, colors, all that UI
> stuff using core data? I really don't want to put extra entities within my
> .xcdatamodel file that deal purely with UI stuff.
It's not entirely clear whether you mean to say that the
coordinates, colors, etc. are ever persisted at all.
IF PERSISTED
What's your aversion to storing this within the nodes themselves? If
they're meant to be persisted at all, and these properties belong to
your Node instances, then there's no obvious reason (from your
description) to create a separate entity to store them. What's the
problem? Be specific.
IF NOT PERSISTED
Your Node entity, by default, uses the NSManagedObject class. This
can be subclassed. Just because your NSManagedObject subclass provides
the ability to managed / persist data with Core Data doesn't mean all
its properties have to be persisted. This is well-covered in the
documentation. Questions? Again be specific. :-)
--
I.S.
_______________________________________________
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