Jump to content

Tutorial on a Core Data UIPickerView iPhone App from Scratch | iPad | iOS

0
  kevlangdo's Photo
Posted Jul 09 2012 05:10 PM

Adding Core Data to a new or existing iOS application is fairly easy. There are several steps you must follow, unless you opt to use of the pre defined templates. Otherwise here are the basic steps

1- Start by adding the CoreData framework to the Frameworks & Linked Libraries on the Summary page

2- Add the CoreData reference to the Prefix.pch file. This is a pre compiler file

3- Add the Core Data Model file (Core Data Editor) using the Model template under the iOS group accessible when you opt to create a new file.

4- Add your Entities, Attributes, Relationships and Predicates as needed using the Core Data Editor

5-Import CoreData library into AppDelegate header

6-Declare NSManagedObjectContext variable

7-Declare NSManagedObjectModel variable

8- NSPersistentStoreCoordinator variable

9- In the AppDelegate, setup your root controller in the didFinishLaunchingWithOptions method

10- Set the managedObjectContext property of the root controller

11- Implement the Core Data variables

12-Implement the Core Data context and NSFetchedResultsController in the view controllers to handle the inserts, updates, selects and deletes

For a full and detailed tutorial and example on how to create or add Core Data to an App, following the instructions in this tutorial: Tutorial on a Core Data UIPickerView iPhone App from Scratch | iPad | iOS

Tags:
0 Subscribe


0 Replies