title: EXC_BAD_ACESS crash xcode
body: <p>I'm getting this crash : <a href="http://i.stack.imgur.com/htYeN.png" rel="nofollow">link</a>
   in my app ,i did many search abou it but i didn't find how to solve it.
   i also enabled Zombies object &amp; Analyzer of xcode but without succes. </p>
  
  <p>Here is my code :</p>
  
  <pre><code>import UIKit
  
  class CameraViewController: UIViewController{
  
  
      @IBOutlet weak var playerContainer: UIView!
      @IBOutlet weak var imageView: UIImageView!
      @IBOutlet weak var loading: UIActivityIndicatorView!
  
      var device : GTLUserendpointGeneralCamera!
      var myfoxCam : CloseliCameraDevice!
      var retryToPlayCount = 0
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          NSNotificationCenter.defaultCenter().addObserver(self,selector: "playerStatusChanged:",name: CameraPlayerStatusChangedNotification,object: nil)
  
          NSNotificationCenter.defaultCenter().addObserver(self,selector: "playerStoppedDispose:",name: CameraPlayerStoppedNotification,object: nil)
      }
  
      override func viewDidAppear(animated: Bool) {
          if(device.brand == "myfox"){
              showLive()
          }
      }
  
      override func viewWillDisappear(animated: Bool) {
          MyFoxManager.sharedInstance.destroyPlayer()
  
      }
  
      deinit {
          NSNotificationCenter.defaultCenter().removeObserver(self)
      }
  
      func showLive(){
          loading.startAnimating()
          MyFoxManager.sharedInstance.showLive(myfoxCam , image: self.imageView)
      }
  
      func playerStatusChanged(notification: NSNotification){
          let waiting = notification.userInfo!["NSLocalizedDescription"] as! Bool
          dispatch_async(dispatch_get_main_queue()) { [weak self] in
              if let strongSelf = self {
                  if(waiting){
                      strongSelf.loading.startAnimating()
                  }else{
                      strongSelf.retryToPlayCount = 0
                      strongSelf.loading.stopAnimating()
                  }
              }
          }
      }
  
      func playerStoppedDispose(notification: NSNotification){
          let code = notification.userInfo!["NSLocalizedFailureReason"] as! Int
          dispatch_async(dispatch_get_main_queue()) { [weak self] in
              if let strongSelf = self {
                  if(code &amp; strongSelf.retryToPlayCount &lt; 4){
                      strongSelf.retryToPlayCount = strongSelf.retryToPlayCount + 1
                      strongSelf.performSelector("showLive", withObject: nil, afterDelay: 2.0)
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>And</p>
  
  <pre><code>import UIKit
  import Foundation
  import CoreBluetooth
  
  class MyFoxManager: NSObject {
  
      static let sharedInstance = MyFoxManager()
      var closeSDK : CloseliSDK!
      var login = false
  
      private override init() {
          closeSDK = CloseliSDK(productKey: MyFoxAppId, withPassword: MyFoxAppSecret, serverType: "us")
      }
  
      func getCamera(device: GTLUserendpointGeneralCamera) -&gt; CloseliCameraDevice? {
          if(!login){
              do {
                  try closeSDK.loginWithToken(device.appUrl, withAccount: device.url)
                  login = true
              }catch{
                  return nil
              }
          }
  
          do {
              let myfoxCameras = try closeSDK.getCameraListError()
              let myfoxCamera = myfoxCameras.filter{$0.deviceUUID == device.idDevice}
              return myfoxCamera[0] as? CloseliCameraDevice
          }catch {
              return nil
          }
      }
  
      func showLive(myfoxCam: CloseliCameraDevice, image: UIImageView){
          closeSDK.preparetoLivePreview(myfoxCam , withUI: image)
      }
  
      func destroyPlayer(){
          closeSDK.destoryPlayer()
      }
  }
  </code></pre>
  
  <p>Notification definition from third-party library :</p>
  
  <pre><code>/**
      Notification for live preview status changing.
   NOTICE: The notification may not be sent by CloseliSDK, so please fill parameter with sender to nil when adding observer
      @param userInfo in NSNotification is a NSDictionary, value for NSLocalizedDescriptionKey is a NSNumber, YES means live preview is buffering, NO means live preview begin.
      BOOL bWaiting = [[[notification userInfo] valueForKey:NSLocalizedDescriptionKey] boolValue];
   */
  extern NSString *const CameraPlayerStatusChangedNotification;
  
  /**
   Notification for player stopped.
   NOTICE: The notification may not be sent by CloseliSDK, so please fill parameter with sender to nil when adding observer
      @param userInfo in NSNotification is a NSDictionary, value for NSLocalizedFailureReasonErrorKey is a NSNumber, represent the reason why it stopped, normally 0.
      long stopReason = [[[notification userInfo] valueForKey:NSLocalizedFailureReasonErrorKey] longValue];
      stopReason: 0x3261-means there is another client playing in p2p mode.
  
  */
  extern NSString *const CameraPlayerStoppedNotification;
  </code></pre>
  
  <p>Any idea ? </p>
  
  <p>Thanks in advance</p>