jessesquires/JSQMessagesViewController

JSQMessagesComposerTextView was deallocated while key value observers were still registered with it

hiren1995 opened this issue · 5 comments

I have an error while loading messages:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x15ec64600 of class JSQMessagesComposerTextView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x15dee6a30> (
<NSKeyValueObservance 0x15f628f20: Observer: 0x162e46a00, Key path: contentSize, Options: <New: YES, Old: YES, Prior: NO> Context: 0x1002bfa10, Property: 0x15ddcc350>
)'

can anyone know whats the reason?

I don't think you are going to receive an answer here. This project is deprecated and I would recommend you use a different framework (Chatto or MessageKit).

@hiren1995 hi. Did you solve the problem?

@ulaserdegor yup I solved that...
this error occurred when I was trying for notification observers...
I simply added the remove observer method to viewDidAppear

@hiren1995 oh greate! but what is observer method ?
there is my class. it works when updated xcode9
screen shot 2017-10-13 at 09 27 28

@ulaserdegor NSNotification observer class is used for live chat means when you send some message and the person replies you you get an notification for that and in appDelegate we create a local notification and in viewDidLoad of our chat screen we use addNotification observer and catch that notification and in the body of that notification we get the message send by the other person so we append that message to message array of JSQMessages and reload the collection view so that we see that message in our chat screen...this way live chat is achieved