Re: Core Data complex structure
Re: Core Data complex structure
- Subject: Re: Core Data complex structure
- From: Sergio Bacchin <email@hidden>
- Date: Tue, 14 Jun 2005 23:02:16 +0200
Thanks for your prompt answer! I'll do some tests following your
concepts asap.
1) The multiple model edit is very helpful! But in my model the Bx
entity will be actually connected to ~10 other entities and I will
instantiate this "sub-tree" 5 times around the "main-tree". Is there
a way to avoid the big mess I'll obtain in the graph? Can abstract
entity or parent entity help somehow?
2) I'm sorry because I'm a newbie, but it is still not clear to me
how can I make an NSOutlineView connected to a NSTreeController
which mirrors the data structure just created. My final goal is to
display a tree of "name" attributes for each object in the data tree,
even if they come from different entities. E.g:
A
--B1.1:name
----C1.1:name
----C1.2:name
----D1.1:name
----D1.2:name
----E1.1:name
--F1:name
----G:name
----B2.1:name
------C1.1:name
------C1.2:name
------D1.1:name
------D1.2:name
...
When I select one line, I'll update a second panel to display all the
other attributes specific to that object.
I'd like to support move,drag&drop,cut&paste,undo&redo etc. Do the
come for free?
I did some trials, but it's still all "dark" for me...can someone
provide me with some guidelines?
Thanks
Sergio
Il giorno 14/giu/05, alle ore 19:13, Bill Bumgarner ha scritto:
On Jun 14, 2005, at 9:50 AM, Sergio Bacchin wrote:
/ C1
B1- D1
/ \ E1
/
A
\ / G
\F- H / C2
\ B2- D2
\ E2
1) The Bx entity (and its related Cx,Dx,Ex) is repeated 2 times in
the graph (they are the same classes). How can I do it in a neater
way? (eg. defining the B->C,D,E subtree, and then instantiating
many times...)
2) Is it possible to represent an attribute in common to all
entities (e.g. name) in a outlineview+treecontroller using
bindings? Any hints?
Cocoa Bindings -- Key Value Coding / Observing, in general -- is
completely decoupled from the model. That is, a user interface
element's value could be bound to the key path "foo.bar.baz" and it
won't care about the class of any of the instances along that path.
So, to answer both (1) and (2), you would simply create a
relationship from (A) to (B) and from (F) to (B). As long as you
configure the relationships identically, including the name, key
paths starting at (A) or (F) that traverse through to (B) and below
will be identical.
Note that you can edit multiple attributes/relationships
simultaneously within Xcode's modeling tools. Since the modeling
tools are all built on Cocoa Bindings, simultaneous editing of
multiple selections comes for free.
b.bum
_______________________________________________
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