iOS调试问题记录

由于新的xcode模拟器不支持iOS6 ,但是app一直需要对iOS6支持(原因你懂的),刚好新来的同事手上有台iOS6.1.3设备,果断给她安装....,

但是.....,

尼玛瞬间尴尬啦!

程序不起来...

各种不行,连接调试...

发现报错-->

dyld: Symbol not found: _OBJC_CLASS_$_NSURLSessionDataTask

  Referenced from: /var/mobile/Applications/2506AACB-16B0-4A84-9523-07ED65DE266C/xxxxxx.app/xxxxxx

  Expected in: /System/Library/Frameworks/Foundation.framework/Foundation

 in /var/mobile/Applications/2506AACB-16B0-4A84-9523-07ED65DE266C/xxxxxx.app/xxxxxx

??神马问题?

Google了下各种说明,初步判断与Foundation有关....

好多答案说把CFNetwork.framework 放到Foundation.framework前面,看看...没用到啊...

也有说把CFNetwork.framework 改为optional

无奈测试吧...结果都不行...

最好猜测不会是Foundation.framework这货要改成optional吧  这么基础的框架也要改为optional  没搞懂啥意思...

改了一试立马好了


最后贴上找的答案:

None of the (platform) frameworks is really "included in the bundle". Instead, your app has a reference ("link") to a framework once you add it to the "Link Binary with Library" build phase. The frameworks are pre-installed on the devices. When you run an app, all the app's framework references are resolved by the dynamic linker (on the device), which means the framework code is loaded so your app can use it.

Some frameworks may not be available on all the devices you intend to support, e.g., PassKit was introduced in iOS 6. If you run an app that links against PassKit on an iOS 5 device, it crashes right after launch, because the dynamic linker cannot find the framework on the device. However, if you weak-link PassKit, the dynamic linker will set all the framework's symbols to nil, if the framework could not be found. This prevents the app from crashing and you can check for the symbols' availability at runtime, e.g.:




你可能感兴趣的:(iOS6)