title: iOS Help: How to use camera to take picture and save it on iPhone?
body: <p>I am new to <code>iPhone</code> development. I need to make an App where the user can take a picture and then its saved on the iPhone and also I have to use <code>SQLite</code> Database to store the image and later display it.</p>
  
  <p>Can anyone help me with sample code and explanation of the procedure?</p>
  
  <p>EDIT: I made a button that uses an UIImageView to take picture, but I'm not sure if it works because I don't have an iPhone:</p>
  
  <pre><code>if ([UIImagePickerController isSourceTypeAvailable:
       UIImagePickerControllerSourceTypeCamera])
  {
      UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
      imagePicker.delegate = self;
      imagePicker.sourceType = 
      UIImagePickerControllerSourceTypeCamera;
      imagePicker.mediaTypes = [NSArray arrayWithObjects:(NSString *) kUTTypeImage,nil];
      imagePicker.allowsEditing = NO;
      [self presentModalViewController:imagePicker animated:YES];
      imagePicker = nil;
      newMedia = YES;
  }
  </code></pre>
  
  <p>The above code uses the front camera</p>