Relations (Save/Update) crash in iOS

I have the same table setup as in the docs.
A Store has a lot of Review objects. A Review has text, id, rating, creator (User). A Store has a column called reviews, which is a one-to-many relationship to Review table.When I try to execute the following method, I get a NSUnknownKeyException.Attached image of the method. And the debugger log.
When I just create a new review object that works fine, but than I cannot connect it with the Store table. So I just followed the documentation as it has the same setup.

Hi Szab,

Could you please try the following format of the request:

backendless.sharedInstance().of( Store.ofClass() ).save( store …

Also, could you point out where in the docs you got that sample code?


Hi Mark,

Sure. I found it here:

Where basically the example project has a Phonebook and each book has multiple contacts. Like i do, just with restaurants and reviews.

I tried your solution, but still get the same result. It has to do something with parsing the elements as it cannot find a key in a dictionary or while decoding. See attached file.

And I used this snippet as yours was missing a persistenceservice object.

(It doesn’t matter if I use persistenceService or data.

Backendless.sharedInstance().persistenceService.of(Store.ofClass()).save(store, response: { (store) -> Void in

                completionBlock(completed: true, store: store as? Store, errorMessage: nil)

            }) { (fault) -> Void in

                completionBlock(completed: false, store: nil, errorMessage: fault.description)


Hi Szab,

You should implement your data model classes in the separate .swift file(s) (i.e. outside the another target class, for example, ViewController).

If you already have done this, we need your whole project to investigate this issue. Please send it (without ‘lib’ folder) to email:



Of course the datamodel and viewControllers are defined in their own classes…

Alright. Message sent.

Hi Szab,

Here is your data model Store class:</img>

It has ‘coordinate’ structure, which cannot be saved in backendless table.

Data model class should contain only basic classes (string, numeric, boolean, date), relations: one-to-one as variable of class, and one-to-many as array of class objects (using ‘generics’ NSArray<ClassName> in obj-c).

Structure, enum, dictionary cannot be used in data model class.

So, please remake your Store class to satisfy this rule, and try again.


Hey Slava,

That is an awesome catch, good eyes. Thanks for helping. It solved my issue. :slight_smile:

Just replaced that property with a function. (For others)

Issue can be closed, marked as solved.

I see your Store class has

var location: GeoPoint?

Maybe, if it contains the same data as ‘coordinate’, then it is enough?

Well, yes. Just wanted to have a convenience property (which should’ve been a function) to get the coordinate.