0

I am trying to access Photo Album using the following code. It works fine on my iPhone or iPad less than 4.0 versions.

  • (void)BrowsePhotoLibrary:(id)sender {
NSArray *types = [UIImagePickerController availableMediaTypesForSourceType:
    UIImagePickerControllerSourceTypePhotoLibrary];

if ([types containsObject:(id)kUTTypeMovie])
{

    UIImagePickerController *imgPickerController = [[[UIImagePickerController alloc] init] autorelease];
    imgPickerController.delegate = self;
    imgPickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    imgPickerController.mediaTypes = [NSArray arrayWithObject:(id)kUTTypeMovie];

    [self presentModalViewController:imgPickerController animated:YES];             
}

}

The same code crashes in iPad 2, 4.3 version if there is atleast one video available in Photo Albums, if Photo album doesn't have any video, then the same code launches to Photo Album. Could someone advise what could be the reason here?

Getsy
  • 4,887
  • 16
  • 78
  • 139
  • I fixed it by changing imgPickerController.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; – Getsy Mar 22 '11 at 12:59

1 Answers1

0

I fixed it by changing imgPickerController.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;

Getsy
  • 4,887
  • 16
  • 78
  • 139