When you change your data model, Core Data detects this and will It's important to check the error, because this will probably fail a [ĪddPersistentStoreWithType:NSSQLiteStoreType initWithManagedObjectModel:self.managedObjectModel] initWithConcurrencyType:NSMainQueueConcurrencyType] You should use the initWithConcurrencyType: initializer to make itĮxplicit that you're using the queue-based concurrency model: We will create a managed object context for the main queue. Next, we will create a simple table view controller that shows the root list of items using a fetched results controller, and add interaction step-by-step, by adding items, navigating to sub-items, deleting items, and adding undo support. The example code for this application is on GitHub.įirst, we will create a PersistentStack object that, given a Core Data Model and a filename, returns a managed object context. Instead of using the Xcode template for Core Data, we will build our stack by hand, in order to fully understand what's going on. The application allows you to create nested lists each list item can have a sub-list, allowing you to create very deep hierarchies of items. In this article, we will build a small but complete Core Data backed application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |