最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

iOS9與XCode7中不能使用http連接的快速解決辦法

 更新時(shí)間:2016年10月24日 11:14:03   投稿:mrr  
這篇文章主要介紹了iOS9與XCode7中不能使用http連接的快速解決辦法,非常不錯(cuò)具有參考借鑒價(jià)值,感興趣的朋友一起看看吧,需要的朋友可以參考下

在Xcode7.0及以上版本中編譯iOS APP時(shí),默認(rèn)會(huì)使用iOS9的一項(xiàng)新特性,使得所有http連接被禁用,項(xiàng)目里使用的API沒(méi)有https支持,就悲劇了。差了官方文檔,有這么一段話

App Transport Security
App Transport Security (ATS) enforces best practices in the secure connections between an app and its back end. ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt; it is also on by default in iOS 9 and OS X v10.11. You should adopt ATS as soon as possible, regardless of whether you're creating a new app or updating an existing one.
If you're developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible. In addition, your communication through higher-level APIs needs to be encrypted using TLS version 1.2 with forward secrecy. If you try to make a connection that doesn't follow this requirement, an error is thrown. If your app needs to make a request to an insecure domain, you have to specify this domain in your app's Info.plist file.

在這里面可以看到,通過(guò)修改Info.plist文件可以繼續(xù)使用http連接,具體的方法如下:

1.在項(xiàng)目左側(cè)找到Info.plist文件,可以通過(guò)Filter來(lái)搜索


2.在右側(cè)點(diǎn)擊Add Row添加NSAppTransportSecurity,類型為Dictionary,然后再添加子項(xiàng)目NSAllowsArbitraryLoads類行為Boolean值為YES


這樣就可以重新使用普通的http連接了。不過(guò)有條件的話,還是去搞一個(gè)https吧.

以上所述是小編給大家介紹的iOS9與XCode7中不能使用http連接的快速解決辦法,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論

大连市| 龙游县| 中西区| 阿图什市| 灵宝市| 富源县| 涿鹿县| 武川县| 治多县| 若羌县| 离岛区| 内黄县| 青龙| 三穗县| 嘉鱼县| 永新县| 葫芦岛市| 仙桃市| 积石山| 依兰县| 双柏县| 确山县| 巴林右旗| 中卫市| 建瓯市| 阜城县| 衡南县| 灌阳县| 昭苏县| 同江市| 宜章县| 茂名市| 称多县| 观塘区| 梅河口市| 蒲城县| 新巴尔虎右旗| 宜春市| 芜湖市| 罗田县| 晴隆县|