Hello dear support team!
I am a developer of the iOS app which uses Backendless
The reason I am writing is that I faced with the issue during the development
I have 1 table in my Backendless and now I am getting crashes during the work with this table. When I try to save the object I get this crash with the reason - "[<NSConcreteValue *> valueForUndefinedKey:]: this class is not key value “coding-compliant for the key objCType”
It does not matter is the object recently created or retrieved from the table and saved again - I get this crash
I was thinking that the issue may be in the inconsistency of data between the table and the class that describes that table in the app. After checking the fields and making them consistent the crash is still happening.
Also the Backendless is acting weird on this table when I try to set new objects with relations to other tables. The pop-up with the error of duplicate fields appears and it is said that the relation is failed to set, but, after the updating of the table the new relations appear in the table’s schema. After this the real tables data begin not to appear and Backendless says that something went wrong and the new crash ticket is created. After the removal of that fields, the data begin to appear again. So. I’d assume that there is a problem with this table and its relations to other tables.
I use Backendless v5.1.0 at the moment (I’ve made a migration from v4.0.17 to 5.1.0, but this did not solve the crash)
Could you please advice how to solve the crash and this weird behavior. Thank you
Do you use the “Dictionary-based” approach or the “Class-based” one to work with the data tables in Backendless? If it is class-based, do your classes have the @objcMembers annotation?
the object causing problems has quite a few properties so not sure I want to reproduce it all here, but the issue only occurs when trying to save. This is an object that has been in the database for a while and we can retrieve the existing data from backendless fine and work with the iOS version of the object within the app, its only when we try to save a new object to backendless or save updates to an existing object that we hit the error. None of the other objects we use are causing problems, can both save them to backendless and update them without issue.
I’ve found the reasons of the "[<NSConcreteValue *> valueForUndefinedKey:]: crash
There were 2 reasons:
1 - The class that was related to this table confirmed MKAnnotation protocol. There were some additional computed properties needed to make the class confirm to the protocol (btw this is strange that this caused the crash since the new properties are not stored but still). After I made a subclass of this class that is related to the table and made this subclass confirm the protocol - the issue on the saving this superclass instance disappeared.
2 - Another problem was with this subclass. Despite the instance of a subclass was force-casted to the instance of the superclass it still was the instance of that subclass, so there were inconsistency of classes and this also caused this crash. So, in order to fix the crash I was needed to create a new instance of superclass and copy the data from the subclass instance