Cant't handle "__originSubID" ios sdk

Hello! I have server answer something like this:

messages: [
“person”: {
“__subID”: “8D44FA9F-DE31-9649-FF81-D19CF1401000”,
“email”: “bnyhw27@privaterelay.com”,
“objectId”: “A24BB7FC-F5D5-4FCF-A302-114F0D4C444B”
“___class”: “Users”,

},
“___class”: “Messages”,
“message”: “messageText”,
“ownerId”: “A24BB7FC-F5D5-4FCF-A302-114F0D4C444B”,
“updated”: null,
“objectId”: “52A6D19E-1A57-46A9-A611-06982EA13251”,
]
“person”: {
“__originSubID”: “8D44FA9F-DE31-9649-FF81-D19CF1401000”
},

I have array of messages, every message have “person” property. Also we could see “__subID” field, this mean this respond also has the same “person”. Evertyhing works good - i could handle “__subID” field.

The second “person” in this respond with “__originSubID” also recognized by backendless swift sdk as BackendlessUser object. But I can’t to get access to the any properties because of “BAD ACCESS” error. BackendlessUser object - is broken and lead to crush…

How should i handle this object? Maybe i something misunderstand? Thanks.

Снимок экрана 2023-07-11 в 14.35.53

Hello @Dmitry_Kalenkov,

Could you please provide the detailed steps to reproduce this issue? or provide a simple code sample that returns this response.

Regards,
Olha

Hello @olhadanylova.
Suppose i have Comments table


Witch have 1:N property to Comments table (replys for comment)

REST Console request url:

https://specialchance.backendless.app/api/data/Comments?sortBy=%60created%60%20desc&relationsDepth=3&groupBy=%60objectId%60

I’ve investigated this issue.
It occurs because of cyclic dependency of person records. Unfortuntely, Swift-SDK cannot handle these dependencies right now, I created an internal ticket to add this possibility.
As for now I can recommend you to use the Dictionary approach as a workaround before the fix is released.

1 Like

Thank you @olhadanylova )