core-data

Where to find some more details on Core Data object model versioning and migration?

I just wonder what this third panel for versioning configuration is, in the Xcode data modeler on the top right, third tab. Want to see some examples for what this is good for and wether or not I should already provide versioning information right from the beginning. Any cool link and hint is appreciated. ...

Problem with CoreData and accessing relationships : request for member in something not a structure or union

Hi I have a question regarding a rather advanced DataModel which I would like to use with CoreData. Before I get into details about what I did so far, I will describe what I want to do. I have a List of Hotel Guests that stay in one Room and have Preferences. Once ready the user should select a guest and see the data and should also b...

Do I really need always a bidirectional relationship in Core Data?

Example: If I had two entities Person and Car, and each of them should be linked with an Image entity - how would this have to look like? Right now, I would make just three Entities: Person, Car, Image. So persons and cars can link to an Image entity. They have a 1:1 relationship to the Image entity. But now, a Core Data dude said that...

How to store Matrix or Vector data structure in Core Data?

I am building an iPhone application that needs to store some sort of matrix or vector data in core data. For some unknown reason, the iPhone SDK does not include any kind of matrix data structure in its foundation classes, so I built my own data structure which uses an NSMutableArray of NSMutableArrays to store the data. So far so good. ...

Is there any reason why someone would want to create an Core Data model programmatically?

I wonder in which cases it would be good to make an NSManagedObjectModel completely programmatically, with NSEntityDescription instances and all this stuff. I'm that kind of person who prefers to code programmatically, rejecting Interface Builder. But when it comes to Core Data, I have a hard time figuring out why I should kill my time ...

How to get objects after CoreData Context merged

Hi, I tried to save data and merge with CoreData and multi-thread for iPhone app. But I can't get managed objects in the main thread after merging. I wrote code just like this: [managedObjectContext performSelectorOnMainThread:@selector(mergeChangesFromContextDidSaveNotification:) withObject:noti...

Problem while adding new Object to CoreData App

Hi Another Day, another CoreData problem,...but hopefully the last one now. Ok here is a copy of what I have : I have a List of Hotel Guests that stay in one Room and have Preferences. Once ready the user should select a guest and see the data and should also be able to add new guest, select the room (maintained also by application) a...

How to group methods belong to one entity in one class file in Core Data like in Entity Framework?

How to group methods belong to one entity in one class file in Core Data like Entity Framework? In Linq, we can put all methods in the domain object class and reuse them, in Core Data, is there any way to create different classes for different entities? Or we can only use predicate to retrieve? It seems that I can't define the class f...

MapReduce in the cloud

Except for Amazon MapReduce, what other options do I have to process a large amount of data? Thank you! ...

Using Core Data with an NSCollectionView

I have an NSCollectionView and I want to use it with Core Data the same way as I would with an NSTableView, preferably with bindings. Can anyone point me in the right direction? Thanks ...

NSOutlineView not refreshing when objects added to managed object context from NSOperations

Background Cocoa app using core data Two processes - daemon and a main UI Daemon constantly writing to a data store UI process reads from same data store Columns in NSOutlineView in UI bound to an NSTreeController NSTreeControllers managedObjectContext is bound to Application with key path of delegate.interpretedMOC NSTreeController...

What exactly is a no-parameter method name?

From the Core Data docs: A property name cannot be the same as any no-parameter method name of NSObject or NSManagedObject—for example, you cannot give a property the name “description” Ok, so -description is blocked for property names. I guess it's because of KVC. But what exactly does "no-parameter" mean? Is that any meth...

When I mark a property as transient, does the type matter?

For example, I make a fullName property and set it to transient. Does it matter what data type that property is, in this case? For example, does it matter if it's set to int or string? As far as I get it, a transient property is almost "ignored" by Core Data. I make my accessors for that and when someone accesses fullName, I simply cons...

What exactly is a fetched property?

What's the point of a fetched property? Does someone have a good example what this is good for? ...

How to store an image in Core Data?

Just a guess: I make an attribute and make it's type "binary". But in the end, how would I use that? I guess there is an NSData behind the scenes? So that attribute actually takes an NSData? ...

Is NSManagedObjectContext autosaved or am I looking at NSFetchedResultsController's cache?

I'm developing an iPhone app where I use a NSFetchedResultsController in the main table view controller. I create it like this in the viewDidload of the main table view controller: NSSortDescriptor *sortDescriptorDate = [[NSSortDescriptor alloc] initWithKey:@"date" ascending:YES]; NSSortDescriptor *sortDescriptorTime = [[NSSortDescript...

applicationWillTerminate Appears to be Inconsistent

This one has me batty. In applicationWillTerminate I am doing two things: saving some settings to the app settings plist file and updating any changed data to the SQLite database referenced in the managedObjectContext. Problem is it works sometimes and not others. Same issue in the simulator and on the device. If I hit the home button wh...

How can Core Data store an NSData?

The documentation says, that core data properties can only store NSString, NSNumber and NSDate types. However, a lot of Core Data users claim Core Data could also store an NSData type. But I wasn't able to see that in the documentation, although the Xcode Data Modeler allows to choose a data type called "binary" (which seems to be NSData...

Why would I want to have a non-standard attribute?

The documentation on Core Data entities says: You might implement a custom class, for example, to provide custom accessor or validation methods, to use non-standard attributes, to specify dependent keys, to calculate derived values, or to implement any other custom logic. I stumbled over the non-standard attributes clai...

Can two managed object context share one single persistent store coordinator?

Example: I have one persistent store coordinator which uses one single persistent store. Now there are two managed object contexts, and both want to use the same persistent store. Could both simply use the same persistent store coordinator, or would I have to create two instances of NSPersistentStoreCoordinator? And if I had to, then: W...