removing an observer

24 views
Skip to first unread message

Jonathan

unread,
Oct 22, 2015, 1:11:48 PM10/22/15
to iphone google group
Having a problem de-allocating an AVPlayerItem even though the observer was removed first.  I reduced the occurrences of that by putting in a sleep command for 0.2 of a second.  But, that hasn't completely solved the problem. 

72] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x166fa250 of class AVPlayerItem was deallocated while key value observers were still registered with it. Current observation info:

Is there any way to know that a removeOberver command has been carried out completely before I reset an object? 

Thanks,
Jonathan 



Jesse Tayler

unread,
Oct 22, 2015, 1:20:23 PM10/22/15
to iphonesdkd...@googlegroups.com
You don't want to sleep

Objects will dealloc  immediately in proper circumstances 

Post code if you like but clearly you have not removed an observer 

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "iPhone SDK Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iphonesdkdevelop...@googlegroups.com.
To post to this group, send email to iphonesdkd...@googlegroups.com.
Visit this group at http://groups.google.com/group/iphonesdkdevelopment.
For more options, visit https://groups.google.com/d/optout.

jonathan.nyc

unread,
Oct 22, 2015, 10:19:28 PM10/22/15
to iPhone SDK Development
Put some NSLog statements all over the place to see what's going on.  You won't be surprised to hear that you're right. 

Had plenty of correct code, so I though everything was under control.  But, one error, which occurs very rarely, caused chaos.  

I'll finalize the new version of the app (FMA Player) when I'm well rested tomorrow. 

Jonathan    


On Thursday, October 22, 2015 at 1:20:23 PM UTC-4, jtayler wrote:
You don't want to sleep

Objects will dealloc  immediately in proper circumstances 

Post code if you like but clearly you have not removed an observer 

Sent from my iPhone

On Oct 22, 2015, at 1:11 PM, Jonathan <jonath...@gmail.com> wrote:

Having a problem de-allocating an AVPlayerItem even though the observer was removed first.  I reduced the occurrences of that by putting in a sleep command for 0.2 of a second.  But, that hasn't completely solved the problem. 

72] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x166fa250 of class AVPlayerItem was deallocated while key value observers were still registered with it. Current observation info:

Is there any way to know that a removeOberver command has been carried out completely before I reset an object? 

Thanks,
Jonathan 



--
You received this message because you are subscribed to the Google Groups "iPhone SDK Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iphonesdkdevelopment+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages