Possible to save NSManagedObject

I am a Parse transplant and am very new to Backendless, but I am enjoying it so far. I was using Parse’s local datastore to manage the offline data of my iOS app. Since Parse went belly up, I’m forced to do it myself so I’m using core data to save to a sqlite database. I use Xcode to generate an NSManagedObject for each of my core data entities. Since NSManagedObject inherits from NSObject, I was hoping it would work with Backendless, but I am getting this error when trying to save an NSManagedObject:

Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[<NSSQLCore 0x1359a5820> valueForUndefinedKey:]: this class is not key value coding-compliant for the key primaryPresentedItemURL.’

Here is an example of the very simple class I tested:

class Message: NSManagedObject {
// Insert code here to add functionality to your managed object subclass

}

extension Message {
@NSManaged var content: String?

}

I also tested this class as a standard NSObject, and it worked just fine. Is saving an NSManagedObject even possible or should I create a separate NSObject class for my Backendless objects?

Thanks for your help.

Hi Adam,

Now you need to use a separate NSObject in Backendless Data Service.
We plan to implement the CoreData support in Backendless asap - we let you know about.

Regards,
Slava

Thank you for the quick response.

I’m a little confused about this. Is there an example anywhere that explains how to do this?

An example showing how to implement NSObject or NSManagedObject? The former is rather trivial, the latter is on the roadmap.

With Backendless PersistentService you should use the data model classes which are inherited from NSObject (or BackendlessEntity)

Hi,

What is your status on implementing NSManagedObject Core data support?

Cheers,

James

No, NSManagedObject Core data is not supported now.