Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Need to set the alert view at next of picker.sourceType = UIImagePickerControllerSourceTypeCamera.
should set the if condition , whether the camera is not occurring ios simulator.

Objective-C
-(IBAction) getPhotoAction:(id) sender {
	UIImagePickerController * picker = [[UIImagePickerController alloc] init];
	picker.delegate = self;
    
	if((UIButton *) sender == camera) {
		picker.sourceType = UIImagePickerControllerSourceTypeCamera;
	} else {
		picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
	}
    
	[self presentModalViewController:picker animated:YES];
}
Posted
Updated 28-Apr-14 16:47pm
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900