_OBJC_CLASS_$_NSURL error with iPhone OS4.0

余生颓废 提交于 2019-12-08 08:39:20

问题


I have a OS3.1 project which now needs to be upgraded via SDK 4.0 But when I try to compile to a device runing 3.1 Im getting this linker error.

dyld: Symbol not found: _OBJC_CLASS_$_NSURL Referenced from: /var/mobile/Applications/E93D0DD1-18EB-4D2E-B99E-23B74EBE42CC/RacingUK.app/RacingUK Expected in: /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /var/mobile/Applications/E93D0DD1-18EB-4D2E-B99E-23B74EBE42CC/RacingUK.app/RacingUK

Base SDK is 4.0 and DeploymentTarget is 3.1. Ive seen that this likely due to Apple moving NSURL but Im not seeing any fixes that work in my case.

Any ideas?

Cheers, Neil


回答1:


This is probably yet another time where you need to weak-link a framework, in this case CoreFoundation. I describe how to do so in this answer, but to repeat:

To weak-link a framework, find your application target in Xcode, inspect it, and go to the General tab. At the bottom of that tab should be a list of frameworks, with a column for Type. Change the Type for CoreFoundation.framework from Required to Weak and rebuild your application. That should take care of the runtime errors.



来源:https://stackoverflow.com/questions/3751657/objc-class-nsurl-error-with-iphone-os4-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!