-
-
Notifications
You must be signed in to change notification settings - Fork 132
app crash at with message message sent to deallocated instance . #214
Comments
So if I'm understanding this the the subscription handler is deallocating? I think we are also missing some context as to how this is implemented. There are probably a half dozen ways to set PLQ up. |
Hi @noobs2ninjas I'm running into the same issue. It looks like @ahsanghauri solved his problem, without ever posting his solution... grrrr.... I can give more context to my situation here:
I am able to get the following error message by enabling the "object zombie" thing in the scheme for objective-C (which I have no idea what that is) 2020-05-21 10:26:00.837072-0500 SwagLeagues[2506:1000754] *** -[SwagLeagues.Message retain]: message sent to deallocated instance 0x176964420 At this point, the Message() object is not saved, nor is the MessageThread() object updated. If I comment out the code to not update the MessageThread() (which triggers the live query update), then the message successfully saves to the server, but is obviously not displayed, as that is processed by the LiveQuery. I've spent 8 plus hours troubleshooting this, stripping down all the extra code down to bare bones in an attempt to pin down what's going on. The best reason for the crash that I can give you is it that I think it has something to do with having that Message() object pinned twice. Once as a pointer from the MessageThread(), and the second as a unique object pinned with the name "Message". I'm assuming that when I attempt to save the new Message() object and update the pointer in the MessageThread() this deallocates in memory the previous Message() object, which is currently being displayed to the user, even though I expressly fetched it from the pin name "Message", and crashes the app. I hope this helps. Most likely I'm doing something that Parse never intended here. I've done my best to understand the docs on what is possible and what is not with using pinning. From my reading, what I'm attempting above should be possible.... Thanks! |
Since I've already wasted too much time on this issue, I decided to fall back to my logic that was working. No more error issues. I changed the following:
As you can guess, this is a bummer for me, as a chat room can have an arbitrarily large number of Message() objects, and storing them in an array is not ideal in that circumstance. |
@ahsanghauri, @ritteraf The LiveQuery feature has been added as a module to the Parse Apple SDK; could you please verify that this issue is fixed there, and if not open a new issue there? |
app crash at return statement.
The text was updated successfully, but these errors were encountered: