I would like to observe an AVPlayerItem instance, but when I am trying to dispose the observer an exception is thrown:
Objective-C exception thrown. Name: NSRangeException Reason: Cannot remove an observer <__XamarinObjectObserver 0x1cb7ad90> for the key path "error" from <__XamarinObjectObserver 0x1cb7ad90> because it is not registered as an observer.
Code:
this.sound = AVPlayerItem.FromUrl(url);
this.soundErrorObserver = this.sound.AddObserver("error", NSKeyValueObservingOptions.New, this.OnErrorDetected);
[...]
this.soundErrorObserver.Dispose();
this.soundErrorObserver = null;
this.sound.Dispose();
this.sound = null;
Am I doing something wrong?