Your SlideShare is downloading. ×
Tutorial 3
Tutorial 3
Tutorial 3
Tutorial 3
Tutorial 3
Tutorial 3
Tutorial 3
Tutorial 3
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Tutorial 3

196

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
196
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Capturar imágenes desde la cámara del iPhoneUtilizaremos el controlador UIImagePickerController paraacceder a las imágenes guardadas en el dispositivo o capturarimágenes desde un iPhone.
  • 2. UIImagePickerController en acción Crear un nuevo proyecto en Xcode de tipo “View-Based Application”
  • 3. Agregar los siguientes elementos en “NombreAppViewController.h”:@interface CamAppViewController : UIViewController<UIImagePickerControllerDelegate, UINavigationControllerDelegate> {UIImageView *imagenView;UIButton *abrirGaleria;UIButton *tomarFoto;}
  • 4. @property (nonatomic, retain) IBOutlet UIImageView *imagenView;@property (nonatomic, retain) IBOutlet UIButton *abrirGaleria;@property (nonatomic, retain) IBOutlet UIButton *tomarFoto;- (IBAction)abrirGaleria:(id)sender;- (IBAction)tomarFoto:(id)sender;
  • 5. Abrir el archivo “NombreAppViewController.xib” (Interface Builder) y agregar 1 UIImageView y 2 UIButton
  • 6. Desde el Connections Inspector enlazar los elementos creados en Interface Builder con Xcode:
  • 7. #import “CamAppViewController.h”@implementation CamAppViewController@synthesize imagenView, abrirGaleria, tomarFoto;- (IBAction)abrirGaleria:(id)sender{// Inicia el ControladorUIImagePickerController * picker = [[UIImagePickerController alloc] init];// Define el Delegatepicker.delegate = self;// Establece el origen de la imagenpicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;// Agrega la vista del controlador a la pantalla[self presentModalViewController:picker animated:YES];}- (IBAction)tomarFoto:(id)sender{UIImagePickerController * picker = [[UIImagePickerController alloc] init];
  • 8. Compilar y ejecutar:

×