views:

30

answers:

1

Hi all,

I have to give functionality to select photos by the user.

I have used this.

ipc.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

Now I have to restrict user to select only photos and i want videos to be not displayed on the list. Or somehow user should not select video at all.

Please suggest some way out.

Thanks and Regards, Ankit

A: 

basically what you're trying to do is to set the "media types". and luckily for you imagePicker has a property just for that called "mediaTypes". :) which receives an array of media types to show for selection.

even luckily-er this is the default behaviour of ImagePicker is to show only image types.

but if you really want to make sure you can do this:

[imagePicker setMediaTypes: [NSArray arrayWithObject:kUTTypeImage]];

and don't forget to add at the top of the file... :)

#import <MobileCoreServices/UTCoreTypes.h>

but really, i think we can trust apple when they say it's they're default behavior... :)

Suicidal