title: iPhone camera shoots photos rapidly, but has problems saving them
body: <p>I'm attempting to take and save photos with the camera rapidly, as quickly as the iPhone can. The problem is that they don't save until the end and it then takes forever, or about 1/2 to 3/4 don't save at all (<code>Write busy</code> error or <code>-[NSKeyedUnarchiver initForReadingWithData:]: data is NULL</code>).</p>
  
  <p>I bet I'm just overloading the phone's memory, but I can't think of a way to handle it efficiently. The standard iPhone camera app can handle it just fine -- snap away at almost 1 photo/second and it saves with no problem.</p>
  
  <p><strong>Any ideas on how to manage the process/memory better so that it can save as it goes but still shoot rapidly?</strong></p>
  
  <p>Here's a bit of my code. <code>takePicture</code> is called whenever <code>self.readyToTake = YES</code>.</p>
  
  <pre>
  - (void)takePicture {
      self.delegate = self;
      [super takePicture];
      self.readyToTake = NO;
  }
  
  - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
      self.readyToTake = YES;
      UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
      UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
  }
  
  - (void)image:(UIImage*)image didFinishSavingWithError:(NSError *)error contextInfo:(NSDictionary*)info {
      if (error)
      {
          NSLog([NSString stringWithFormat:@"** ERROR SAVING PHOTO: %@", [error localizedDescription]]);
      }
  }
  </pre>
  
  <p>Thank you for your help!</p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>If I resize the photos to much smaller dimensions before saving, like 480x640, I have no problem saving quickly. However, I'm wanting to capture and save full-size images. The native Camera app seems to handle it fine.</p>