title: AVCaptureDevice devicesWithMediaType: Does not update after added/removed camera
body: <p>I'm building an OS X app and since it uses the camera I'd like to know when a new one becomes available or when one disappears (is unplugged). My hope with the following code was that when I plugged in a new USB camera or unplugged one I would get a different count in devices available. However, the count never changes. If I start with no camera attached it outputs 1 (for the built-in camera) and still stays 1 after I have plugged in a new USB camera. Likewise, if I start with 2 and unplug it with the app running it still says 2 after the camera has been unplugged.</p>
  
  <p>If I restart the whole app it always reports the correct number of devices.</p>
  
  <pre><code>appDelegete:
  -(void)startLoop
  {
      while (true)
      {
          [self getCams];
          usleep(1000000);
      }
  }
  
  -(void)getCams
  {
      cameraTest *test = [[cameraTest alloc] init];
      [test enumerateDevices];
  }
  
  cameraTest:
  -(void)enumerateDevices
  {
      NSArray *devices = [AVCaptureDevice devicesWithMediaType: AVMediaTypeVideo];
      NSLog(@"Number of devices found: %lu", (unsigned long)devices.count);
  }
  </code></pre>
  
  <p>How can I get an updated count of devices while my app is running?</p>
  
  <p>I also tried to subscribe to</p>
  
  <blockquote>
    <p>AVCaptureDeviceWasConnectedNotification and
    AVCaptureDeviceWasDisconnectedNotification</p>
  </blockquote>
  
  <pre><code>testCamera:
  -(id)init
  {
      self = [super init];
      if (self)
      {
          [[NSNotificationCenter defaultCenter] addObserver:self
           selector:@selector(cameraAdded:)
               name:AVCaptureDeviceWasConnectedNotification
             object:nil];
          [[NSNotificationCenter defaultCenter] addObserver:self
           selector:@selector(cameraRemoved:)
               name:AVCaptureDeviceWasDisconnectedNotification
             object:nil];
      }
      return self;
  }
  
  -(void)cameraAdded:(NSNotification *)notification
  {
      NSLog(@"A camera was added");
  }
  
  -(void)cameraRemoved:(NSNotification *)notification
  {
      NSLog(@"A camera was removed");
  }
  </code></pre>
  
  <p>But I did not receive any callbacks after plugging in/unplugging a USB camera.</p>