使用视频的图像选择器。奇怪的编译器错误
我一直在尝试让视频正常工作,但遇到了编译器问题的奇怪问题。我的代码看起来像这样。
UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
NSArray *sourceTypes = [UIImagePickerController availableMediaTypesForSourceType:imagePicker.sourceType];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
[self presentModalViewController:imagePicker animated:YES];
[imagePicker release];
我收到的编译器错误说:
未定义的符号:“_kUTTypeMovie”, 参考自: EditViewController.o 中的 _kUTTypeMovie$non_lazy_ptr (也许您的意思是:_kUTTypeMovie$non_lazy_ptr)ld:找不到符号collect2:ld 返回 1 退出状态
我已经为此工作了一段时间,但无法弄清楚我的问题出在哪里。我已经导入了核心服务,因此我可以访问 kUTTypeMovie。
I have been trying to get video to work and have been getting an odd issue with a compiler issue. My code looks like this.
UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
NSArray *sourceTypes = [UIImagePickerController availableMediaTypesForSourceType:imagePicker.sourceType];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
[self presentModalViewController:imagePicker animated:YES];
[imagePicker release];
The compiler Error I am getting says:
Undefined symbols: "_kUTTypeMovie",
referenced from:
_kUTTypeMovie$non_lazy_ptr in EditViewController.o
(maybe you meant: _kUTTypeMovie$non_lazy_ptr) ld: symbol(s) not found collect2: ld
returned 1 exit status
I have been working at this for a while and can't figure out where my issue is. I have imported Core Services so I have access to kUTTypeMovie.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过调用 availableMediaTypesForSourceType: 来测试相机?
通过添加 MobileCoreServices 框架并相应地使用 #import 导入它来解决问题。
have you tried a call to availableMediaTypesForSourceType: for testing the camera ?
Problem sloved through adding the MobileCoreServices framework and importing it with #import accordingly.