I am new to working with Core Data, and am working with a UITableView. I have a toolbar with a UISegmentedController, and I want to filter the items in the UITableView based on the selected index. In other words, suppose I have a UITableView that displays Books (stored in Core Data) and a UISegmentedController with segments to display books in “English”, “Spanish”, and “French”.
What is the approach here to get everything hooked up? When one of the segments is clicked, what do I do in the UISegmentedControl’s target to change things around?
Sorry if it’s a stupid question!
I would use a separate
NSFetchedResultsControllerfor each segment. This will allow you to take advantage of the built in cache for each segment and improve performance.In addition to Apple’s documentation (and my book), you can also read up on them from my article Touching The Core in the PragPub magazine.