Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

pcs are junk

macrumors 65816
Original poster
Sep 28, 2009
1,046
0
hi guys, i am trying to start an awesome photography application, but i need to know how to link a button to open the photo library, so people can choose their picture and edit it. i also would like to know how to make the camera button access the camera. please help me out here, i need to get the basics down before i go into the extremely hard stuff. thanks in advance! oh btw, please dont tell me to learn objective c, because the way i learn things is by people telling me how to do it. like people think that im not learning anything if theyre doing it for me, but i really am because i am starting to understand what the words and symbols mean. so i am learning objective c just by people telling me what to do. thanks!
 

drf1229

macrumors regular
Jun 22, 2009
237
0
In that case, try something like this:

Code:
-(IBAction) getPhoto:(id) sender {
	UIImagePickerController * picker = [[UIImagePickerController alloc] init];
	picker.delegate = self;
	
	if((UIButton *) sender == choosePhotoBtn) {
		picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
	} else {
		picker.sourceType = UIImagePickerControllerSourceTypeCamera;
	}
	
	[self presentModalViewController:picker animated:YES];
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.