Hello ! I am new in backendless.
I need to make a simple table with categories and few items that belong to categories
I have a problem with getting data from backendless, because i make class that must be compatible with backendless and Realm.
The problem is getting array from backendless:
class Category: Object {
dynamic var objectId = ""
dynamic var name = ""
dynamic var listNumber = 0
dynamic var imageName = ""
dynamic var image: NSData? = nil
dynamic var created: NSDate?
dynamic var updated: NSDate?
var dishes = List<Dish>() // <- my problem
…
Problem with ‘dishes’.
Backendless manual says that i should do like this
https://backendless.com/feature-16-data-retrieval-api-how-to-load-objects-from-an-mbaas-storage/
var locations : [Location] = []
but Realm says that it not supports NSArray, and will work with List<Type> Format,
dynamic var dishes: [Dish] = [] // Terminating app due to uncaught exception 'RLMException', reason: ''NSArray' is not supported as an RLMObject property. All properties must be primitives, NSString, NSDate, NSData, RLMArray, or subclasses of RLMObject. See https://realm.io/docs/objc/latest/api/Classes/RLMObject.html for more information.'
But when i get array from backendless , description of array looks like:
▿ [1] : Category {
objectId = 52E0D354-F1B1-2F64-FFD8-B4129ED0DA00;
name = Паста;
listNumber = 2;
imageName = pasta.png;
image = <(null) — 0 total bytes>;
created = 2016-03-12 17:07:35 +0000;
updated = 2016-03-12 17:34:36 +0000;
dishes = (
);
}
There is no dishes.
What i should do ? Please help.
I found a topic with the same problem
http://support.backendless.com/t/store-data-with-realm-retrieved-by-backendless-same-as-parse-localstorage
but there is no answer what to do