Ashish Agarwal Ashish Agarwal - 1 year ago 126
iOS Question

Use of undeclared identifier 'kUTTypeMovie'

I am getting the error message - Use of undeclared identifier 'kUTTypeMovie'

in the below code -

-(IBAction)selectVideo:(id)sender {
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil];

imagePicker.delegate = self;
[self presentModalViewController:imagePicker animated:YES];

What's wrong with it ?


Answer Source

You have to add the framework MobileCoreServices to the project, and then import it:

#import <MobileCoreServices/MobileCoreServices.h>

That will make the problem go away.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download