iOS 5 an instance of AVPlayerItem was deallocated

前端 未结 3 421
情话喂你
情话喂你 2021-01-02 22:03

When I try to play a video from my iPhone (located in the documentsDirectory), I get the following error using iOS 5 while it was working fine with iOS 4.3:

An insta

3条回答
  •  醉酒成梦
    2021-01-02 22:32

    Ah. You're observing a TekkPoint object from a SomethingElse object, and the SomethingElse object is the one adding and removing the observers, correct? (That's the normal way things are done; I'm just trying to clarify.)

    It looks like your TekkPoint object is being deallocated while the SomethingElse that's observing it is still around. The SomethingElse dealloc method isn't called because it's the TekkPoint that's being deallocated, not the SomethingElse.

    If you're planning on observing an object which may disappear before the observer disappears, then you need some way of notifying the observers that they should remove their observers. Your TekkPoint could have an alive property which would also be observed by the SomethingElse, and when it gets set to NO then everyone observing the TekkPoint would remove themself as an observer.

提交回复
热议问题