core-data

Possible core-data bug: attributes named 'updated' don't work correctly?

I have a Core Data entity called Post. One of it's attributes is called updated and it is a date. The stored XML looks like this: <attribute name="updated" type="date">266164481.00000000000000000000</attribute> From this I concluded that the data is being stored correctly. When I read the data back the returned value is a NSCFNumber, ...

mach_msg_trap in core-data

What is meant by mach_msg_trap error? I'm developing an application with core-data. I get this error when ManagedObjectContext if a different thread is "used" the second time. I've a producer consumer kind of threading system. The producer thread and the consumer thread uses the same underlying sqlite db, but different managedobjectConte...

Update results of NSFetchedResultsController without a new fetch

I'm working on an application that holds its data in an external MySQL server, but caches it locally using Core Data for better response times. Basically, what I'd like to do is this: Fetch data from Core Data (SQLite data store, using NSFetchedResultsController) and display it Grab new items from the MySQL server in the background Ref...

Core Data store atomicity with multiple stores

Core Data allows you to add multiple persistent stores to a single NSPersistentStoreCoordinator (each with a different configuration) name, thereby bringing them together in a single NSManagedObjectContext. What I haven't been able to find out is how Core Data handles atomicity of a save operation for multiple stores. Let's say I have t...

Storing binary data within core data on an iPhone

If I record an audio file and I have a core data object representing that recording... should I be referencing just the url to the recording on disk, or could I just store it within core data? It's probably easier to just store it within core data, but doesn't sound like a very good idea. ...

Do I have to call super in NSManagedObject didTurnIntoFault ?

Hi, do I have to call super in didTurnIntoFault? I couldn't find any directions in the documentation. - (void)didTurnIntoFault { [super didTurnIntoFault]; // Do I have to call super? // ... } ...

What do I have to do to get Core Data to automatically migrate models?

I have read in the documentation about automatic /lightweight migration for Core Data models - but am having problems in the reality of implementing it. As I understand it the application should notice that the model it has and the model that exists on a device already are not the same. If you have only added attributes or relationships...

How to create relational object in Objective-c for iPhone

Here is the interface of my object: @interface MyItem : NSObject { sqlite3 *database; NSInteger *primaryKey; NSInteger *accountKey; NSInteger *categoryKey; NSString *title; BOOL hydrated; BOOL dirty; NSData *data; // Why do I need this? } The primary key will be auto generated in Sqlite and I am storing the integers, foreign k...

What is the type for boolean attributes in Core Data entities?

I am using Core Data programmatically (i.e. not using .xcdatamodel data model files) in much the same manner as depicted in Apple's Core Data Utility Tutorial. So my problem is that when I try to add an attribute to an entity with the type NSBooleanAttributeType, it gets a bit buggy. When I add it to my NSManagedObject subclass header fi...

iPhone, Core Data and JSON

I have a web site with an API which publishes the information using JSON. I can access this API fine, but I would really like to store the information in an iPhone application using Core Data. Is there a way to hook the Persistent Store to the JSON API so rather than having to keep them in sync using some algorithm I can just use the w...

How to hookup or create Sqlite DB with Core data model in iPhone

I am able to create the DataModel, Entities and Properties. How do I now create the DB? Do I have to create it manually making sure that all the properties and entities are mapped? I am following the Recipes Core Data sample and have noticed a method in RecipesAppDelegate.m: - (NSPersistentStoreCoordinator *)persistentStoreCoordinator ...

How to create classes after creating Core Data model in Xcode for iPhone

I have created my Model, Entities, Properties and Relationships in Xcode. How are the classes for my Entities created? Do I have to manually create them? ...

Core Data: Strange bindings error on re-opening a document. Help?

Hi, I have been building a core data application to administrate some data and I've been stumped by a bug that indicates my objects aren't KVO compliant. However, I haven't modified the default KVO compliance of the NSManagedObject, and now I'm left scratching my head. The area of the application that the bug is affecting is that of cre...

Identity property in core data modeling tool

I'm currently migrating my sqllite application to using core data. When I created the data model I noticed that an attribute can be marked as and Identity property. Happily I marked that attribute as required and indexable only to find out that I have to supply the value myself or the insert of the entity fails, which kind of takes away ...

Removing a binary attribute's data(used in NSImageView) in Core Data entity

Hello guys, I have an optional binary attribute: image , containing an image for my entities. In the interface, I have NSImageView (Image Well), and a "Remove Image" button. When the image removing button is clicked, I do: - (IBAction)saveAction:(id)sender { NSError *error = nil; if (![[self managedObjectContext] save:&error]) { ...

Core Data Migration really Slow, Why does it happen at all?

I'm developing a desktop Mac OS X App that saves its very simple data into SQLite with Core Data and a companion mobile App for iPhone that simply needs to read data from the desktop App. Although they share the same Managed Object Model when I load the SQLite database on the mobile app the data takes several seconds to migrate the data....

is it worth using core data for a simple sqlite app on the iphone with one table and no relationships or complicated subtable/views?

From now on should one use core data as a wrapper for a small iphone app with an sqlite single table database? Does it unnecessarily complicate things or is it good practice to use from now on? ...

Core Data vs Sqlite and performance...

I am wondering if anyone has any real world numbers on performance differences between an old sqlite application which has been converted to Core Data in the 3.0 SDK. I suspect that under the hood Core Data is just using sqlite anyways and that it add's a bit of overhead for the cost of convenience, but i thought i would ask anyways. ...

Core Data XML import/export of single object

With Core Data, specifically on Cocoa Touch, is it possible to export and import individual objects in XML format (irrespective of the underlying store format, ideally)? I'm asking this because I'm using Core Data to manage my object graph anyway, and I need to send and receive my objects in XML format with HTTP. So it would be conveni...

Core data, NSArrayContainer Arraycontent of many arrays

Hello I've got three entities in my application so far: tag, feed and story A tag has got a to-many relationship to feeds and feeds has got a to-many relationship to story. I've got an NSArrayController for each entity, one named tags, one named feeds and one named stories. They all share the same 'managedObjectContext' which they ge...