iOS (swift) - improper response received in release build

Hello. I have this block of code to retrieve data from a table.

let query = BackendlessDataQuery()
 response: {
 (inds: BackendlessCollection!) -> () in
 let currentPage = inds.getCurrentPage()
 for ind in currentPage
 print("\(ind)") // THIS line prints different responses
 let ind = ind as? WIndustry // THIS crashes ONLY in release build,not in debug
 error: { (fault: Fault!) -> () in

Line number 9:
While debugging, it prints <MyAppName.Windustry 0xsomepointerhere>
and the cast in line number 10 executes successfully.
But in release build, it prints something like this:
{ “__class” : .WIndustry;
“__meta” : “[…]”;
“name” : Engineering
“id” : 5
… }
and the cast in line 10 crashes.
How to handle it?

Hi Zeba,

This tells me that the library could not find the “WIndustry” class when the data was sent back from the server. Would could cause this in the release build? Possibly class is not included into the build? Or the name gets obfuscated?


Hi Mark,

Just before this code block, I’m creating an object of class “WIndustry” and it’s working fine. So the class is included in the build and recognized by the code. What do I do now?

Hi Zeba,

Could you please verify whether the issue still persists?