使用xocde7.0你必须要注意的几件事

1.发送http网络请求

使用xcode7发送网络请求,控制打印台可能输出如下错误提示:

App Transport Security has blocker a cleartext HTTP(http://)resource load since it is insecure.Temporary exceptions cane configured via your app's Info.plist file


那是因为苹果新特性要求App内访问网络请求,把所有的HTTP协议都改成了 HTTPS 协议,使用 TLS1.2 SSL加密请求数据

在URL前加https://前缀表明是用SSL加密的。 你的电脑与服务器之间收发的信息传输将更加安全。Web服务器启用SSL需要获得一个服务器证书并将该证书与要使用SSL的服务器绑定。http和https使用的是完全不同的连接方式,用的端口也不一样,前者是80,后者是443。http的连接很简单,是无状态的,... HTTPS协议是由SSL+HTTP协议构建的可进行加密传输、身份认证的网络协议要比http协议安全
官方文档参考

解决办法

1.在Info.plist中添加 NSAppTransportSecurity 类型 Dictionary 。

2.在 NSAppTransportSecurity 下添加 NSAllowsArbitraryLoads 类型Boolean ,值设为 YES




2.xcode7在真机上运行项目或者打包时可能会收到如下错误信

息:


ld:‘/Users/**/Framework/SDKs/PolymerPay/Library/mobStat/lib**SDK.a(**ForSDK.o)'does not contain botched.You must rebuildit with botched enabled (Xcode setting ENABLE BITCODE),obtain an updated library from the vendor,or disable botched for this target.for architecture arm64.


苹果官方文档给出了关于bitcode的定义:Bitcode is an intermediate representation of a compiled program.Apps you upload to iTunes Connect that contain botched will be compiled and linker on the App Store.Including botched will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.


说的是bitcode是被编译程序的一种中间形式的代码。包含bitcode配置的程序将会再App store上被编译和链接。bitcode允许苹果再后期重新优化我们程序的二进制文件,而不需要我们重新提交一个新的版本到App store上。


Bitcode. When you archive for submission to the App Store, Xcode will compile your app into an intermediate representation. The App Store will then compile the bitcode down into the 64 or 32 bit executables as necessary.

当我们提交程序到App store上时,Xcode会将程序编译为一个中间表现形式(bitcode)。然后App store会再将这个botcode编译为可执行的64位或32位程序。

因为现在某些类库活SDK还不支持bitcode所以会有错误提示,如果出现不支持的情况可以在BuildSetting中搜索bitcode将其关闭。

并且:

  • 对应iOS,bitcode是可选的。

  • 对于watchOS,bitcode是必须的。

  • Mac OS不支持bitcode。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值