苹果在Xcode7中,将之前的http改为了https。所以,如果是刚刚升级Xcode7的朋友可能会遇到之前能正常网络请求,但升级之后发现,什么数据都请求不到了。并且打印输出如下警告:
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app’s Info.plist file
解决办法:
在Info.plist中添加 NSAppTransportSecurity 类型 Dictionary ;
在 NSAppTransportSecurity 下添加 NSAllowsArbitraryLoads 类型Boolean ,值设为 YES
如果我们有时候模拟器能够正常运行,但是真机测试的时候,却报错了。
*** does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
解决办法:
Targets下Build Settings 搜索bitcode,改为NO
网友评论