ios4 – xcode4“dyld:未找到符号:_OBJC_CLASS _ $_ AVCaptureDevice”错误

我的iPhone应用程序在 IOS 4.3模拟器中运行,但没有任何其他IOS 4.0模拟器.即使它会在那里运行.

我收到以下错误

GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)
copyright 2004 Free Software Foundation,Inc.
GDB is free software,covered by the GNU General Public License,and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “x86_64-apple-darwin”.Attaching to process 71564.
dyld: Symbol not found: _OBJC_CLASS_$_AVCaptureDevice
Referenced from: /Users/qianfan/Library/Application Support/iPhone Simulator/4.2/Applications/XXXX-XXXX/XXXX.app/XXXX
Expected in: /Developer/Platforms/iPhonesimulator.platform/Developer/SDKs/iPhonesimulator4.2.sdk/System/Library/Frameworks/AVFoundation.framework/AVFoundation
in /Users/qianfan/Library/Application Support/iPhone Simulator/4.2/Applications/XXXX-XXXX/XXXX.app/XXXX
sharedlibrary apply-load-rules all
(gdb)

我的应用程序正在使用(静态引用)最新的ZXing iphone代码(截至2011-03-31 2001-04-24测试的两个版本).

我相信AVCaptureDevice存在于所有iOS 4.0中,而zxing正在支持ios 4.0.
当我做:

Macintosh:zxing-trunk XXX$grep _OBJC_CLASS_$_AVCaptureDevice /Developer/Platforms/iPhonesimulator.platform/Developer/SDKs/iPhonesimulator4.3.sdk/System/Library/Frameworks/AVFoundation.framework/*
Binary file /Developer/Platforms/iPhonesimulator.platform/Developer/SDKs/iPhonesimulator4.3.sdk/System/Library/Frameworks/AVFoundation.framework/AVFoundation matches

有什么建议?我会在这找什么?非常感谢.

解决方法

我只想提一下mmilo的答案(关于将’required’改为’Optional’)为我解决了这个问题.只需单击AVFoundation.framework(在Project视图中的Frameworks文件夹下),然后确保打开最右侧视图窗口.您可以在此处将“目标成员资格”从“必需”更改为“可选”.

我的具体问题与梅尔文的问题相同.在使用4.3 SDK时,我无法让我的项目在4.2模拟器上编译,因为它无法找到AVCaptureDevice类.

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...