Backendless Support
 
Waiting for user's response

iOS (swift) - improper response received in release build

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

  1. let query = BackendlessDataQuery()
  2. self.backendless.data.of(WIndustry.ofClass()).find(
  3. query,
  4. response: {
  5. (inds: BackendlessCollection!) -> () in
  6. let currentPage = inds.getCurrentPage()
  7. for ind in currentPage
  8. {
  9. print("\(ind)") // THIS line prints different responses
  10. let ind = ind as? WIndustry // THIS crashes ONLY in release build,not in debug
  11. }
  12. },
  13. error: { (fault: Fault!) -> () in
  14. print("\(fault)")
  15. }
  16. )
  17. }

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?

Leave a Comment

Comments (3)

photo
1

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?

Regards,

Mark

photo
1

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?

photo
photo
1

Hi Zeba,

Could you please verify whether the issue still persists?