Weak Reference issue
My App uses CoreAudio and CoreVideo frameworks (supported in iOS4 or later). Now I want my app to be run in device 3 or later. For that i have made core audio and core video frame work to Weak Reference. but it is still g开发者_JAVA百科iving same problem.
dyld: Symbol not found: _OBJC_CLASS_$_AVCaptureDevice
Referenced from: /var/mobile/Applications/67EDB406-FBEF-4FA4-8B6A-752CD9E3DA31/TescoClubCard.app/TescoClubCard
Expected in: /System/Library/Frameworks/AVFoundation.framework/AVFoundation
The AVCaptureDevice
class was introduced in iOS 4.0, so it will not be available to use when your app is running on pre-4.0 devices. You should conditionalize the code in your app so that you first check for the presence of this class and only use its methods if it is present (i.e., if you are running on a 4.0 or later OS).
The Using Weakly Linked Classes in iOS document contains very good instructions on how to determine whether a given class is available for your app to use, and a related section of that document Using Weakly Linked Methods, Functions, and Symbols explains how you can check for specific methods or functions.
So basically, you need to wrap the parts of your code that use 4.0 and later API's in conditional statements so that devices with earlier OS's do not try to use that code because those libraries do not exist in that version of the OS.
The SDK Compatibility Guide document may also be helpful.
精彩评论