Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Alexander Certosimo
Alexander Certosimo
1,774 Points

A bit confused on Core data between view controllers

Hello everyone,

I am a bit confused on how exactly you are able to verify that data saved is saved to the correct attribute in core data. For example, i have an entity Name that has an attribute of name. Once a name is created and saved in core data, i append it to an array as well. I then use the array to populate a tableview. Now what i am confused about is when an item in the tableview is selected it takes you to a screen where i want user inputted data to be saved under that selected name in core data. I did set up relationships in my core data model, i am just not sure how to pass the currently selected name to the next VC. My guess is i will have to use preparforsegue, i am just not sure how exactly to implement it in this situation with core data.

Example is i choose the name "john" from my tableview, it segues me to the information input screen, how do i know the data entered will be saved the name john and not another name in core data?

any help is appreciated