Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You need to use the <code>UIImagePickerController</code> class, basically:</p> <pre><code>UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = pickerDelegate picker.sourceType = UIImagePickerControllerSourceTypeCamera </code></pre> <p>The <code>pickerDelegate</code> object above needs to implement the following method (<strong>EDIT</strong> This is now deprecated, see below):</p> <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo; </code></pre> <p>Within the body of that method the image object is the data from the camera which you can then use for your specific application.</p> <p><strong>EDIT</strong></p> <p>In iPhone OS 3.0 <code>didFinishPickingImage</code> is deprecated, so instead you'll need to implement:</p> <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info </code></pre> <p>The dictionary <code>info</code> will contain entries for the original, and the edited image, keyed with <code>UIImagePickerControllerOriginalImage</code> and <code>UIImagePickerControllerEditedImage</code> respectively. (see <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIImagePickerControllerDelegate_Protocol/UIImagePickerControllerDelegate/UIImagePickerControllerDelegate.html" rel="noreferrer">http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIImagePickerControllerDelegate_Protocol/UIImagePickerControllerDelegate/UIImagePickerControllerDelegate.html</a> for more details)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload