xcode7,ios9 部分兼容设置

神奇的苹果公司,再一次让程序员中枪。程序员

1、xcode7 新建的项目,Foundation下默认全部http请求都被改成https请求.xcode

HTTP+SSL/TLS+TCP = HTTPS服务器

也就是说,服务须要提供https(TLS 1.2)的接口;app

若是服务不改变,则客户端info.plist的根<dict>需加下面的键值;框架

简单信任全部http服务器
<key>NSAppTransportSecurity</key>
<dict>
    <!--Connect to anything (this is probably BAD)-->
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

或者严谨的
<key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>yourserver.com</key>
    <dict>
      <!--Include to allow subdomains-->
      <key>NSIncludesSubdomains</key>
      <true/>
      <!--Include to allow insecure HTTP requests-->
      <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
      <true/>
      <!--Include to specify minimum TLS version-->
      <key>NSTemporaryExceptionMinimumTLSVersion</key>
      <string>TLSv1.1</string>
    </dict>
  </dict>
</dict>

2、xcode7 默认开启,bitcode(iwatch须要),则会致使部分第三方框架报错(好比友盟的错误)
dom

youmeng/libMobClickLibrary.a(MobClick.o)' 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 armv7ide

这是要么更新库,要么能够在 build setting 中,搜索bitcode,并吧 enable bitcode 设置为 NOui

 

3、iOS9安装企业证书打包的appthis

企业证书打包的app,安装到手机里面后第一次打开app。不会像之前提示,信任仍是不信任该证书;url

这是个时候须要iOS9 设置-》通用-》描述文件-》企业级应用 中信任对应的企业开发者。

 

4、iOS9 URL Schemes 

除了要在项目info URL Types中设置URL Schemes,还须要在info.plist里面增长可信任的调用app,不然回报以下错误

-canOpenURL: failed for URL: "weixin://app/wx9c8771d3c07dfd30/" - error: "This app is not allowed to query for scheme weixin"

-canOpenURL: failed for URL: "wtloginmqq2://qzapp" - error: "This app is not allowed to query for scheme wtloginmqq2"

info.plist加入

<key>LSApplicationQueriesSchemes</key>

<array>

<string>urlscheme</string>

<string>urlscheme2</string>

<string>urlscheme3</string>

<string>urlscheme4</string>

</array>

5、iPad适配Slide Over 和 Split View

分屏应用最好把纯代码改成stroyboard

相关文章
相关标签/搜索