使用视频的图像选择器。奇怪的编译器错误

发布于 2024-09-13 08:21:10 字数 833 浏览 4 评论 0原文

我一直在尝试让视频正常工作,但遇到了编译器问题的奇怪问题。我的代码看起来像这样。

 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

森林迷了鹿 2024-09-20 08:21:10

您是否尝试过调用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文