Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-13-2011, 03:45 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 167
ipodphone is on a distinguished road
Default How to make this camera face front?

I have this code

Code:
- (IBAction)cam{
	// Create image picker controller
	UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
	
	// Set source to the camera
	imagePicker.sourceType =  UIImagePickerControllerSourceTypeCamera;
	
	// Delegate is self
	imagePicker.delegate = self;
	
	// Allow editing of image ?
	imagePicker.allowsImageEditing = NO;
	
	// Show image picker
	[self presentModalViewController:imagePicker animated:YES];
	
}
I want it to start up using the front camera.
ipodphone is offline   Reply With Quote
Old 09-13-2011, 03:48 PM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Documentation is your friend: Loading… > cameraDevice -- > UIImagePickerControllerCameraDeviceFront
baja_yu is offline   Reply With Quote
Old 09-13-2011, 03:48 PM   #3 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Quote:
Originally Posted by UIImagePicker Class Reference
UIImagePickerControllerSourceTypeCamera
Specifies the device’s built-in camera as the source for the image picker controller. Indicate the specific camera you want (front or rear, as available) by using the cameraDevice property.
Straight from the docs
smithdale87 is offline   Reply With Quote
Old 09-13-2011, 04:03 PM   #4 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 167
ipodphone is on a distinguished road
Default

Tried:

cameraDevice = UIImagePickerControllerCameraDeviceFront;

and some others, but received sigbart error
ipodphone is offline   Reply With Quote
Old 09-13-2011, 04:03 PM   #5 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

It should be

Code:
 imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
And you need to be running on the device, not the simulator (which has no camera), and you need to be using a device with a front facing camera, and running iOS 4.0 or higher (as you can see in the docs)
baja_yu is offline   Reply With Quote
Old 09-13-2011, 04:07 PM   #6 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Right, you definitely need to check that all of the proper devices are available before trying to use them, as baja implied. Also was there any additional info with the SIGABRT?
smithdale87 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 408
15 members and 393 guests
7twenty7, Eclectic, eski, EvilElf, fiftysixty, HemiMG, iOS.Lover, JackReidy, jarv, sacha1996, teebee74, tim0504, UMAD, VinceYuan, yuncarl28
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,672
Threads: 94,121
Posts: 402,905
Top Poster: BrianSlick (7,990)
Welcome to our newest member, yuncarl28
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:09 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0