On Mon, Mar 9, 2009 at 1:49 PM, Karolis Ramanauskas <karol...@gmail.com> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to