Working with UITableViewDelegate and UITableViewDataSource methods

iOS Tutorial: Editing TableViews xCode 7.3 demo Basics Declare an Array data structure numberOfSectionsInTableView numberOfRowsInSection cellForRowAtIndexPath 1. Declare an Array data structure The table always matches an array(s) of some sort to represent data. Each row matches up to an element in the array.

2. numberOfSectionsInTableView The first order things is to let the […]

NSFetchedResultsController

frc-basic-demo The signatures of the delegate methods reveal the true purpose of the NSFetchedResultsController class. On iOS, the NSFetchedResultsController class was designed to manage the data displayed by a UITableView or a UICollectionView. It tells its delegate exactly which records changed, how to update the user interface, and when to do this.

Creating the […]

Writer-Main-Worker Core Data Stack

xCode 7.3 demo We set up our stack just like the diagram. Note that in _mocDidSaveNotification method:

if your savedContext.parentContext is the main context, it will pause the main thread a little bit in order to do that save. Hence, you may want to use a wait cursor, or something to signify that the […]

Core Data – Child save context, propogate up to Parent

xCode 7.3 demo Parent-Child Contexts An important point that you need to get a good grip on is that contexts can be chained such that one is the child of another. CoreDataStack.h

CoreDataStack.m

We create a private (child) and parent context. The parent is what connects to the Persistent Store Coordinator. The child […]

Async Fetch Request – part 2

xCode 7.3 AsyncFetchRequestEx2 Fetch Request

Result Block

The Async Fetch Request

Perform the async fetch request with a context

Async Fetch Request – part 1

xCode 7.3 demo, AsyncFetchRequestEx1 Setting up the Stack We create the core data stack called BNRCoreDataCoordinator.

Then we set up the PSC and MOC… 1) Set up lazy loading accessor for NSPersistentStoreCoordinator 2) Set up lazy loading accessor for NSManagedObjectContext Notice that the MOC is connected to the PSC:

MOC Saving

Inserting […]