title: Disable camera focus on startup
body: <p>When I start the camera on my iPad 3 with iOS 6 the camera does a focus operation. This is how I am doing it with AVFoundation framework:\</p>
  
  <pre><code>//
  // AppDelegate.h
  //
  
  @interface AppDelegate : UIResponder &lt;UIApplicationDelegate&gt;
  
  @property (strong, nonatomic) UIWindow *window;
  
  
  @property (strong, nonatomic) AVCaptureSession *session;
  @property (strong, nonatomic) AVCaptureVideoPreviewLayer *captureVideoPreviewLayer;
  @property (strong, nonatomic) AVCaptureDevice *device;
  @property (strong, nonatomic) AVCaptureDeviceInput *input;
  @property(nonatomic, strong) AVCaptureStillImageOutput *stillImageOutput;
  
  @end
  
  //
  //  AppDelegate.m
  //
  
  
  @implementation AppDelegate
  @synthesize session;
  @synthesize captureVideoPreviewLayer;
  @synthesize device;
  @synthesize input;
  @synthesize stillImageOutput;
  
  
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {    
      device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
      NSError *error = nil;
  
      if (([device hasMediaType:AVMediaTypeVideo]) &amp;&amp;
          ([device position] == AVCaptureDevicePositionBack) ) {
          [device lockForConfiguration:&amp;error];
          if ([device isFocusModeSupported:AVCaptureFocusModeLocked]) {
              device.focusMode = AVCaptureFocusModeLocked;
              NSLog(@"Focus locked");
          }
  
          [device unlockForConfiguration];
      }
  
      session = [[AVCaptureSession alloc] init];
      session.sessionPreset = AVCaptureSessionPresetPhoto;
  
      captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:session];
      [captureVideoPreviewLayer setAffineTransform:CGAffineTransformMakeRotation(-M_PI / 2)];
  
  
      input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&amp;error];
      if (!input) {
          // Handle the error appropriately.
          NSLog(@"ERROR: trying to open camera: %@", error);
      }
      [session addInput:input];
  
      stillImageOutput = [[AVCaptureStillImageOutput alloc] init];
  
      NSDictionary *outputSettings = [[NSDictionary alloc] initWithObjectsAndKeys: AVVideoCodecJPEG, AVVideoCodecKey, nil];
      [stillImageOutput setOutputSettings:outputSettings];
  
      [session addOutput:stillImageOutput];
      [session startRunning];
  
      return YES;
  }
  </code></pre>
  
  <p>I am specifically locking focus on <code>AVDevice</code> on startup  (<code>device.focusMode = AVCaptureFocusModeLocked;</code>), but when camera starts, it performs a focus operation. In my application I don't want this to happen, for purposes of camera calibration. </p>
  
  <p>How can I avoid focus being fired on camera initialization?</p>