Questions tagged [nsmanagedobjectmodel]

An NSManagedObjectModel object describes collection of entities that you use in your application. It is available in OS X v10.4 and later and available in iOS 3.0 and later .

56 questions
37
votes
7 answers

How to use Core Data's ManagedObjectModel inside a framework?

I'm trying to migrate a specific part of one of my apps into a framework so that I can use it in my app itself and in one of those fancy new iOS 8 widgets. This part is the one that handles all my data in Core Data. It's pretty straight forward to…
flohei
  • 5,248
  • 10
  • 36
  • 61
19
votes
2 answers

CoreData. What's the difference between indexes and indexed?

I'm looking to speed up queries to my SQL backed CoreData instance (displaying records sorted by date). I know that indexing can help decrease query time, but what's the difference between: Highlighting the entity that an attribute belongs to, then…
VaporwareWolf
  • 10,143
  • 10
  • 54
  • 80
10
votes
4 answers

CoreData warning: Multiple NSEntityDescriptions claim the NSManagedObject subclass

I am suddenly getting a bunch of warnings on iOS12/XCode 9. Why are there multiple managedObjectModels ? The app only has one *.xcdatamodeld file but there are multiple versions within the model. Is this some new iOS12 Coredata feature and is…
Duncan Groenewald
  • 8,496
  • 6
  • 41
  • 76
4
votes
2 answers

what are differences between Managed object model and Persistent object store?

From apple CoreData framework docs, Managed object model: A model allows Core Data to map from records in a persistent store to managed objects that you use in your application. Refer here. Persistent object store: A persistent object store maps…
Nandha
  • 6,746
  • 2
  • 23
  • 33
4
votes
4 answers

How to open an existing .mom file, or is there any way to see the structure of an existing .mom file

I've downloaded a copy of iOS source code and there is a .mom file in the bundle. I just know it is a "product" of NSManagedObjectModel. I wonder is there any way that I can explore the entities in the file, or is there any code snippet to parse its…
Harvey
  • 65
  • 1
  • 4
3
votes
2 answers

Building a NSManagedObjectModel from several models

There are several reasons why somebody wants to merge multiple NSManagedObjectModel's. If you search the web, all responses are that it is not possible or that it is only possible for two unrelated entities that share one or more relationships. See…
user965972
  • 2,489
  • 2
  • 23
  • 39
3
votes
1 answer

NSManagedObjectModel - create model dynamically

Can anyone point me to a tutorial on building the core data model dynamically in Xcode? All tutorials I found are based on a static design but the apple documentation says it is possible to build the model programatically..sadly no example on that…
pooja-ios
  • 31
  • 2
2
votes
0 answers

XCode doesn't generate fetched properties together with attributes and relationships when you create NSManagedObject subclass

When you create your NSManagedObject subclass from data model, XCode generates your class with all defined attributes and relationships, but doesn't include fetched properties. As far as I remember it wasn't an issue in older versions of XCode.…
berec
  • 775
  • 10
  • 19
2
votes
0 answers

CoreData: desired type = Towns; given type = Towns - Unacceptable type of value for to-one relationship

I'm scratching my head since after a few hours I still can't understand this. I have 2 entities in my Core Data model: Towns Restaurant I have defined the relationship one to many and inverse. (yep, you've got it, a Town can have multiple…
2
votes
1 answer

'+entityForName: nil is not a legal NSPersistentStoreCoordinator for searching for entity name

Getting the exception later in the program when _managedObjectModel is being used. Below is initialiser code. NSURL *modelURL = [[NSBundle mainBundle] URLForResource:self.managedObjectModelName withExtension:@"momd"]; _managedObjectModel =…
Amresh
  • 786
  • 7
  • 11
2
votes
2 answers

ManagedObjectModel subclass doesn't work in Swift

To summarize what I've done: Created a project named 2048. Created a subclass of NSManagedObject class BestScore: NSManagedObject { @NSManaged var bestScoreModel: BestScoreModel func update(score: Int) { self.bestScoreModel!.score =…
Bing
  • 181
  • 1
  • 3
  • 12
2
votes
0 answers

How to create two persistent stores in one persistent store coordinator

I need to create two persistent stores, each with their own entities, with one persistent store coordinator. The hard part is, I want one persistent store to be linked to iCloud, but the other to only be a local store. I have read about making…
Chandler De Angelis
  • 2,646
  • 6
  • 32
  • 45
2
votes
2 answers

How can I update the coredata records after rearranged the tableview cells

I know this question has been asked before, However, I'm still confused as to how to implement reordering with a UITableView cells in a Core Data project.Below mentioned code i have used in my project for rearranged the TableView cells. After…
2
votes
2 answers

Unacceptable type of value for to-one relationship. desired type = (null);

So I've just converted my Core Data model to code so it can easily fit into a static library. Unfortunately its not a smooth conversion. I'm getting this error when trying to insert a new Player as a relationship for another class named…
Ryan Poolos
  • 18,421
  • 4
  • 65
  • 98
1
vote
1 answer

CoreData: Delete propagation prefetching failed using NSCKImportOperation

I am testing CoreData+CloudKit, i.e. I am using an NSPersistentCloudKitContainer that handles all communication with iCloud. When I launch the app, CoreData automatically synchronizes with iCloud, i.e. (among others) inserted or updated records are…
1
2 3 4