Search code examples
iphoneobjective-cipadcore-datauitableview

CoreData Confusion


I am starting out with CoreData and have managed to incorporate it into my project. I did this by making a new project with CoreData included and based all the code of what I am given there, helping me understand it a little.

Now the new project lets me add a time stamp and then view the details of that. However what I want o achieve uses multiple attributes in my entity and this has gotten me a little stumped as to how to handle them.

What I want to achieve: The user sees a tableview with each object represented by the 'firstName' and 'lastName' attributes. So they see a list of people. Then when selecting a person, it will bring up a new view (UINavigationController being used) in which further attributes can be seen and altered, such as 'gender' and 'age' as examples.

I am a little stumped; Ray Wenderlich's introduction to CoreData has helped, but doesn't quite guide me in the right direction.


Solution

  • Are you a registered iPhone developer? You should check out Apple's sample code. The CoreDataBooks project does exactly this. Here's a link. I used this to set up my own Core Data project recently.

    They also are extremely efficient in handling everything, including adding, editing, and deleting objects. You should probably just edit this project, if all you want to do is what you described in the question.