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

View Single Post
Old 08-29-2008, 03:04 PM   #3 (permalink)
mikeb
ZipZest.com
 
Join Date: Aug 2008
Posts: 43
mikeb is on a distinguished road
Default

As hijinks said with the simulator use the photo library in the camera picker. Then some code like the following to automatically use the camera when the app is on the iphone (code could be made shorter - tidy up as need be):

Code:
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {

	picker = [[UIImagePickerController alloc] init];
	picker.sourceType = UIImagePickerControllerSourceTypeCamera;

	picker.delegate = self;
	picker.allowsImageEditing = NO;
}
else if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {

	picker = [[UIImagePickerController alloc] init];
	picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

	picker.delegate = self;
	picker.allowsImageEditing = NO;
}
else {
	picker = nil;

	UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"No Camera Found"
	message:@"You need an iPhone with a camera to use this application."
	delegate:self
	cancelButtonTitle:@"Cancel"
	otherButtonTitles:@"Ok", nil];

	[alertView show];
	[alertView release];
}
mikeb is offline   Reply With Quote
 

» Advertisements
» Online Users: 423
15 members and 408 guests
acegames, andyzaharia, djbrooks111, Droverson, esoteric, fanarin, Free App Monster, ilmman, inkcpp, jbro, kilobytedump, malaki1974, minglei, Nuncha, raheel
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,433
Threads: 94,026
Posts: 402,590
Top Poster: BrianSlick (7,978)
Welcome to our newest member, caraldo32
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:50 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.