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)
我在我的应用程序中添加了一个 UIImagePickerController,当我去编译时,我得到了上述错误。我找到了一个解决方案:
查找符号 (kUTTypeImage) 并找到它应该存在的图像/库(在本例中为 MobileCoreServices.framework)。然后将您的二进制文件与该框架链接。
问题是,我不确定如何实现它。如何查找符号,然后将其链接到框架?
应该注意的是,我已经导入了 MobileCoreServices 框架。以下是相关代码:
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];
}