jessesquires / JSQMessagesViewController

An elegant messages UI library for iOS
https://www.jessesquires.com/blog/officially-deprecating-jsqmessagesviewcontroller/
Other
11.14k stars 2.82k forks source link

JSQMessagesCollectionViewIncoming memory error #994

Closed niklas22 closed 9 years ago

niklas22 commented 9 years ago

Hello everyone!

I'am currently creating a Chatapplication with JSQMessageViewController. Anyway all functions work well until the delete function.

To my issue: I have a tableView with all Chatpartner. If i click one, i'll get navigated to the JSQMessageViewController.

On a longpress event, i added a delete selector.

i delete them like this:

func deleteEntrybyIndexPath(indexPath: [NSIndexPath]) {
    self.collectionView?.performBatchUpdates({ () -> Void in
        self.appdel.user.chats[self.partnerIndex].removeMessageByIndex(indexPath[0].row, isMedia: self.isMedia)
        self.collectionView?.deleteItemsAtIndexPaths(indexPath)

    }, completion: nil)
}

this works fine but when i navigate back to my tableView it crashes

After enabling zombie objects in the Diagnostics i get this error:

[JSQMessagesCollectionViewCellIncoming release]: message sent to deallocated instance 0x7fc76acf08b0.

I hope i displayed my issue properly, if there are any questions let me know.

alezoffoli commented 9 years ago

I can confirm this happens to me too after long pressing a bubble, selecting a custom event, and then navigating back to my tableView. And my "custom event" doesn't do anything for now...

This doesn't happen if I select a normal action like Copy though.

*\ -[JSQMessagesCollectionViewCellOutgoing release]: message sent to deallocated instance 0x12fa57ac0

--- EDIT and it appears it's already mentioned on #1026 and fixed in #1027 Thanks! :+1:

jessesquires commented 9 years ago

thanks @alezoffoli for confirming this was the same as #1026 / #1027.

closing as resolved / dupe.