I am testing an iPad app on the device and its giving me the following 开发者_运维技巧error:
Symbol not found: _OBJC_CLASS_$_NSURL
The application works fine on the Simulator, but not on device.
Usually that means you have not added a framework to you class, though why it would work n the simulator but not the iPhone is odd, make sure you have the FoundationKit added to your project.
Your code is using a symbol that is not present in the libraries available on the device, while it is available on the simulator.
If you inspect your project, you will found that the "deployment target" (say, 3.1.3) is set to something different to your "base SDK" (say, 4.0). This means that in the code you are allowed to use all the symbols available for the base SDK (and the simulator will provide that environment, or the one you choose from among the available SDKs in the Xcode popup menu), but when you are on a device you could be using the "deployment target", which is older and lacks that symbol.
Either you use a newer base SDK (if it is acceptable for you) or you use conditional compiling to avoid using symbols not available on older devices.
Look also at this S.O. article.
精彩评论