Core Data and the theory or best practice of passing data between views

I am playing around with the ipad split view with core data.

In my RootView I get a list of titles for records using core data.  If the user chooses something in the RootView I want to display this full record in the DetailView.

My question is what is the best way to do this?

My experience with databases and other languages would be to pass the records ID to the detailViewController.detailItem and then the DetailViewController can get the whole record.

But something tells me or I have the feeling that it should be easier with core data and that maybe I should be passing a NSManagedObject or something like this.

Could you please assist.
LVL 20
Who is Participating?
NSManagedObject lives usually in AppDelegate. Basic idea of using CoreData is "don't think about implementation" so I would recommend you tp pass only data into detail controller which you need. If it's a whole object (DB record) or its part is up to your implementation
darbid73Author Commented:
Ok I understand your first sentence but then IF i understand you correct you are sitting on the fence.  Basically you are saying do it how I like.  So for me the easiest seem to be to pass just a primary key to the detail view and then get the whole record as that view is loading.
darbid73Author Commented:
Thanks - would have liked to hear more and understand our dicussion.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.