Hello. I have this block of code to retrieve data from a table.
let query = BackendlessDataQuery()
self.backendless.data.of(WIndustry.ofClass()).find(
query,
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
print("\(fault)")
}
)
}
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?