sahin / VideoSplashKit

VideoSplashKit - UIViewController library for creating easy intro pages with background videos
MIT License
1.22k stars 137 forks source link

App craches using facebookSDK with VideoSplashKit #29

Open JeanVinge opened 8 years ago

JeanVinge commented 8 years ago

I Don't know why but my app is crashing because of this line of code,

        self.moviePlayer.player?.addObserver(
          self,
          forKeyPath: "status",
          options: .New,
          context: nil)

observation: when commenting this line of code, i solve the error

the problem is, i have a button that make the login with facebook, and the video in the background, using VideoSplashKit, when i make the login with facebook, we go to the facebook webview, and when going back to the app i get this error:

* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x13ddf3f10 of class AVPlayer was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x13f303980> ( <NSKeyValueObservance 0x13ddc01f0: Observer: 0x13dd76fd0, Key path: status, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x13df64dd0> )' * First throw call stack: (0x18269edb0 0x181d03f80 0x18269ecf8 0x182ff2d80 0x1821458e8 0x101035a3c 0x10103b4e4 0x182654d50 0x182652bb8 0x18257cc50 0x183e64088 0x187866088 0x1000b3784 0x18211a8b8) libc++abi.dylib: terminating with uncaught exception of type NSException