找不到符号:kUTTypeImage [英] Symbol not found: kUTTypeImage
本文介绍了找不到符号:kUTTypeImage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从复制了一些代码。 apple的文档 - 我收到了这两个错误:
I copied some bits of code from apple's documentation- and I got these 2 errors:
Undefined symbols for architecture i386:
"_kUTTypeImage", referenced from:
-[ImagePicker imagePickerController:didFinishPickingMediaWithInfo:] in ImagePicker.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我做错了什么?
编辑:
代码:
The code:
- (IBAction) showSavedMediaBrowser {
[self startMediaBrowserFromViewController: self
usingDelegate: (id)self];
}
- (BOOL) startMediaBrowserFromViewController: (UIViewController*) controller
usingDelegate: (id <UIImagePickerControllerDelegate,
UINavigationControllerDelegate>) delegate {
if (([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypeSavedPhotosAlbum] == NO)
|| (delegate == nil)
|| (controller == nil))
return NO;
UIImagePickerController *mediaUI = [[UIImagePickerController alloc] init];
mediaUI.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
// Displays saved pictures and movies, if both are available, from the
// Camera Roll album.
mediaUI.mediaTypes =
[UIImagePickerController availableMediaTypesForSourceType:
UIImagePickerControllerSourceTypeSavedPhotosAlbum];
// Hides the controls for moving & scaling pictures, or for
// trimming movies. To instead show the controls, use YES.
mediaUI.allowsEditing = YES;
mediaUI.delegate = delegate;
[controller presentViewController:mediaUI animated:YES completion:nil];
return YES;
}
- (void) imagePickerController: (UIImagePickerController *) picker
didFinishPickingMediaWithInfo: (NSDictionary *) info {
NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
UIImage *originalImage, *editedImage, *imageToUse;
// Handle a still image picked from a photo album
if (CFStringCompare ((__bridge_retained CFStringRef) mediaType, kUTTypeImage, 0)
== kCFCompareEqualTo) {
editedImage = (UIImage *) [info objectForKey:
UIImagePickerControllerEditedImage];
originalImage = (UIImage *) [info objectForKey:
UIImagePickerControllerOriginalImage];
if (editedImage) {
imageToUse = editedImage;
} else {
imageToUse = originalImage;
}
// Do something with imageToUse
}
[[picker parentViewController] dismissModalViewControllerAnimated: YES];
}
我认为错误是最后一个方法开始的地方,但我不是确定。
I think the error is where the last method starts, but I'm not sure.
您的帖子没有太多上下文来解释代码部分;请更清楚地解释你的场景。
Your post does not have much context to explain the code sections; please explain your scenario more clearly.
推荐答案
查找符号( kUTTypeImage
)并找到它应该存在的图像/库(在这种情况下为 MobileCoreServices.framework
)。然后将二进制文件与该框架链接起来。
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.
这篇关于找不到符号:kUTTypeImage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文