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

Puns.h and Puns.m save methods

what method is being called that allows the text to stay saved in the TableViewController?

1 Answer

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

Pun is a subclass of NSManagedObject which implements the basic behavior required of a Core Data model object, like access to the managed object context (MOC). The MOC is responsible for several managed objects and also responsible for persisting them to a persistent store like a database. The terminology is explained in this video. The data from the database is loaded in the punsArray using the NSFetchedResultsController. The instance of NSFetchedResultsController also registers to receive change notifications on the managed object context that holds the fetched objects. Any change in the context that affects the result set will then be reflected in the table view.