Posts Categorized: Core Data

Magical Records: Edit, Add, and Delete Records

First, we need some buttons to let us perform some actions on the table. Edit your view controller as follows:

Now we need to setup methods for the two buttons. First, lets wire up the addTestRecord method we created in the last tutorial just to make sure our button works (and to give us some… Read more »

TableViewController: Detail View

Now we have a list, lets create a detail view for each note. First, create a new view controller (File>New>New File>Cocoa Touch>Objective-C Class) named NoteDetailViewController that is a subclass of UIViewController. Next, drag out a new View Controller in Interface Builder, give it the custom class NoteDetailViewController and add 2 labels and a textview (make sure it is not editable… Read more »

Magical Record: Simple Core Data

Installation Personally I hate adding libraries by simply dragging and copying files into my code. The mixing between my own code and external libraries can quickly become confusing and difficult to disentangle. My favourite way to add libraries is Cocoa Pods. It’s very easy to install and even easier to use. I won’t get into the… Read more »

UITableViewController and NSFetchedResultsController

NSFetchedResultsController takes a lot of the work out of managing the display of data returned from a Core Data fetch request. The basic mechanism is to create a fetch request detailing what you are looking for, how to filter it, and how to order the results. This is then attached to a new NSFetchedResultsController, which queries… Read more »

Magical Record and NSFetchedResultsController: Core Data made easy

I was pretty happy after building my first iOS app that made extensive use of the Core Data framework. However, in the back of my mind I was sure there was a better way than the ton of code it required. Thankfully there is. Magical Record makes it so simple that it barely feels like Core… Read more »