core-data

Core Data Error With Persistent Store

妖精的绣舞 提交于 2020-01-13 18:10:57
问题 I am trying to load simple data from a model using Core Data and putting it into a table view. Here is the following code for my persistent store: //AppDelegate.m - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (__persistentStoreCoordinator != nil) { return __persistentStoreCoordinator; } NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"vofasmmmnmgd.sqlite"]; if (![[NSFileManager defaultManager] fileExistsAtPath:[storeURL path]]) { NSURL

Core Data Error With Persistent Store

非 Y 不嫁゛ 提交于 2020-01-13 18:07:05
问题 I am trying to load simple data from a model using Core Data and putting it into a table view. Here is the following code for my persistent store: //AppDelegate.m - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (__persistentStoreCoordinator != nil) { return __persistentStoreCoordinator; } NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"vofasmmmnmgd.sqlite"]; if (![[NSFileManager defaultManager] fileExistsAtPath:[storeURL path]]) { NSURL

Core Data: Inheritance, STI or otherwise?

狂风中的少年 提交于 2020-01-13 18:01:27
问题 I can't seem to find any information in the documentation or via Google on this, but if there is something, a pointer to it would be great. In my app, I have a Thing as a core data class. I intend to have that Thing contain many Item s which has a bunch of fields in it, like order and created_date and so forth. However, there are a variety of Item types, each with their own set of fields. Ideally, I'd like to create several subclasses of Item , so that I can access all the items together in a

Quirk with Core Data, protocols, and readwrite vs. readonly property declarations

非 Y 不嫁゛ 提交于 2020-01-13 16:24:53
问题 I'm running into an odd quirk involving Core Data, a declared protocol, and perhaps the LLVM 1.5 compiler. Here's the situation. I have a Core Data model that among others has two classes, IPContainer and IPEvent, with IPContainer being the parent entity of IPEvent. Each entity has a custom class in the project for it, created using mogenerator. mogenerator generates an additional subclass that just contains the modeled property declarations, so the class hierarchy is actually IPEvent >

Quirk with Core Data, protocols, and readwrite vs. readonly property declarations

倾然丶 夕夏残阳落幕 提交于 2020-01-13 16:23:12
问题 I'm running into an odd quirk involving Core Data, a declared protocol, and perhaps the LLVM 1.5 compiler. Here's the situation. I have a Core Data model that among others has two classes, IPContainer and IPEvent, with IPContainer being the parent entity of IPEvent. Each entity has a custom class in the project for it, created using mogenerator. mogenerator generates an additional subclass that just contains the modeled property declarations, so the class hierarchy is actually IPEvent >

Passing a managedObjectContext through to a UITabBarController's views

左心房为你撑大大i 提交于 2020-01-13 12:16:12
问题 I have an app which is based on the Utility template (where you flip over the view to see another). On the first view there is a login screen, then it flips over to reveal a UITabBar style interface. I'm having trouble working out how to pass the managedObjectContext from the App Delegate (where it is created) all the way through to each of the Tab Bar's views. App Delegate's managedObjectContext get passed to FrontLoginViewController which gets passed to BackViewTabBarViewController .. where

Clearing a context in Core Data: reset vs deleting registered objects?

我的梦境 提交于 2020-01-13 10:46:10
问题 I was looking for posts regarding to this, but I don't fully understand... What is the difference between: [context reset]; and: for (NSManagedObjectID *objId in objectIds) { [context deleteObject:[context objectWithID:objId]]; } Or are they equivalent? Thanks 回答1: Using reset puts the managed object context back to the state it was in when you first created it-- before you had performed any fetches, created any new objects, etc. If you have any managed objects in memory that were fetched

Matching an approximate string in a Core Data store

放肆的年华 提交于 2020-01-13 07:57:11
问题 I have a small problem with the core data application i'm currently writing. I have two differents models, contexts and peristent stores. One is for my app data, the other one is for a website with relevant infos to me. Most of the time, I match exactly one record from my app to another record from the other source. Sometimes however, I have to fallback to fuzzy string matching to link the two records. I'm trying to match song titles. My local title could be the (made up) "The French Idealist

iCloud sync not sending data through ubiquity container

爷,独闯天下 提交于 2020-01-13 07:05:00
问题 I have been using iCloud in my apps for a while now and am recently having an issue where devices refuse to talk to each other. Or at least that's what I thought until I started logging the methods where the merging takes place. My persistentStoreCoordinator is set up as described in a previous question of mine. The problem is the following. When setting up my managedObjectContext , I add an observer to it to view the NSPersistentStoreDidImportUbiquitousContentChangesNotification notification

iCloud sync not sending data through ubiquity container

不想你离开。 提交于 2020-01-13 07:03:32
问题 I have been using iCloud in my apps for a while now and am recently having an issue where devices refuse to talk to each other. Or at least that's what I thought until I started logging the methods where the merging takes place. My persistentStoreCoordinator is set up as described in a previous question of mine. The problem is the following. When setting up my managedObjectContext , I add an observer to it to view the NSPersistentStoreDidImportUbiquitousContentChangesNotification notification