Undefined symbols for architecture i386:
"_kUTTypeImage", referenced from:
-[ViewController receiveNotification:] in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I’m adding a UIImagePickerController to my app and when I go to compile I get the above error. I found a solution on SO:
Symbol not found: kUTTypeImage
Look up the symbol (kUTTypeImage) and locate the image/library it should exist in (MobileCoreServices.framework in this case). Then link your binary with that framework.
Problem is, I’m not sure how to implement it. How do I look up the symbol and then link it to the framework?
Should of noted I already have the MobileCoreServices framework imported. Here’s the relevant code:
if ([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypeCamera]) {
UIImagePickerController* myCamera = [[UIImagePickerController alloc] init];
myCamera.delegate = self;
myCamera.sourceType = UIImagePickerControllerSourceTypeCamera;
myCamera.mediaTypes = [NSArray arrayWithObjects:(NSString *) kUTTypeImage, nil];
myCamera.allowsEditing = NO;
[self presentModalViewController:myCamera animated:YES];
}


You only need to add and then import the framework into your project (or rather, target). In the Navigator, click on your project, and select a target. Then go to the Build Phases tab and, if it’s not expanded already, expand Link Binary With Libraries. Then add MobileCoreServices.framework. In the file you want to use kUTTypeImage, add this import:
#import <MobileCoreServices/MobileCoreServices.h>Note that you use angle brackets (<>) and not quotes as you would normally.