Posts Tagged: 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: – (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [self setupView]; [self setupFetchedResultsController]; } – (void)setupView { // Create Edit Button UIBarButtonItem *editButton = [[UIBarButtonItem alloc] initWithTitle:@”Edit” style:UIBarButtonItemStyleBordered target:self action:@selector(editNotes:)];… 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 »