I have a custom hosted API in Backendless, with several methods.
I’m trying out a method “getMyStatistic” which is supposed to return a GameStatistic custom object.
When using the generated iOS async method to call this API, neither the response or fault callback are never called.
I’ve tried debugging it with CodeRunner, and I can see that the server function is being executed and is correctly returning a GameStatistic object. However, the callback in iOS is never executed.
Using the web API inspector, I can see the results of the call, with correct data in the response body.
So I decided to try the sync method, and it returns an object but it doesn’t cast into a GameStatistic object and when I try to access any of its properties, it crashes:
[__NSDictionaryM timeInSeconds]: unrecognized selector sent to instance 0x7fdf9218bac0
I can see in the debug console that the object is of class __NSDictionaryM, and it has the information I need in several key-value pairs.
What could be going on here? I would need to use the Async method, but I would like to understand why are both errors happening.
Hello jdev,
What language do you use for the CBL?
Could you post an example of the CBL method and the invocation code in your client app. Please use external copy-paste tool like pastebin.com.
I think this was happening because I was calling the async method from a background thread. I’ve changed it to execute from main thread, and it works again.