Choose any photo on iPhone not just Camera Roll

Discussion in 'iOS Programming' started by newtoiphonesdk, Nov 28, 2010.

  1. newtoiphonesdk macrumors 6502a

    Joined:
    Jul 30, 2010
    #1
    I have the following code that I use to either choose a picture or take one with the camera on the iPhone.
    Code:
    -(IBAction) getphoto:(id) sender {
    	UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    	picker.delegate = self;
    	
    	if((UIButton *) sender == choosephoto) {
    		picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
    	} else {
    		picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    	}
    	
    	[self presentModalViewController:picker animated:YES];
    }
    The only issue I have is that it will only give me access to items in the camera roll, and not other events that were synced to the iPhone. Is there a way I can set it to choose any photo on the phone?
     
  2. Comrade Yeti macrumors newbie

    Joined:
    Nov 3, 2010
    #2
    use UIImagePickerControllerSourceTypePhotoLibrary
     

Share This Page