Re: Newbie Core Data question.
Re: Newbie Core Data question.
- Subject: Re: Newbie Core Data question.
- From: Gustavo Pizano <email@hidden>
- Date: Sun, 11 Oct 2009 12:00:21 +0200
Matthew hello:
Well I have developed some cocoa apps, and I have a medium background
on WebObjects, so EO and WO uses bindings also, so even some things
are different the binding theory its quite similar. (ie, KVC)
I read the Core Data programing guide, and well I found lot;'s of
similarities.
I want to achieve is that from the first list in the first view, I can
do a drag and drop to the second view, and once dropped I want to show
the data, so first I was trying setting the selected item directly,
into the second view, and having a NSIObjectController in that second
nib, that it's an entity of USer, with the manageObjectContext to be
from the file Owners, ( which is the ViewController, that its getting
from the applications's delegate the managedObjectContext), and the
content to be the selectedUser which is class of User :
NSManagedObject. Then in the labels that I have place to show the info
I tryed the bindings, as:
Value:
Bidn to : Custom Object Controller (the NSObjectController I mentioned
above)
but I can't set the Key Model and key path to something to work..
:S
I want to have those views (the list and the details) separated
because probably in the future Im gonna reuse then in another view,
so thats why I don't want to put them together.
I dunno if I made myself a little more clear of what I want..
thanks in advance.
Gustavo
On Oct 11, 2009, at 11:27 AM, Matthew Lindfield Seager wrote:
Hi Gustavo,
I'm no expert but one way is for the second controller's Content
Array or Content Set to be bound to some property of the first
controller's selection.
For example if you have an entity "Foo" with a to-many relationship
called "bars" you would:
- bind the "content set" of bars array controller
- to "foo array controller" (or whatever it is called)
- controller key of "selection"
- model key path of "bars"
There are numerous Core Data tutorials that will guide you through
this process but if you haven't already I would suggest you heed the
Core Data warnings when it suggests you learn some other
technologies (e.g. bindings, KVO, KVC) first.
Matt
_______________________________________________
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