Xcode7 遇到问题和解决方法

用 Xcode7 Beta2 版本创建的项目拷贝到别人的电脑上面打开的时候出现 『target specifies product type 'com.apple.product-type.bundle.ui-testing', but there's no such product type for the 'iphonesimulator' platform』错误,能够正常在机器上面运行,但是有一个错误或者警告;

解决方法:
1、定位到自己程序的文件夹;
2、选中后缀为 『xcodeprog』 文件,右键,显示包内容;
3、找到后缀为 『pbxproj』 的文件,右键,打开;
4、搜索所有的 『com.apple.product-type.bundle.ui-testing』,并且用『com.apple.product-type.bundle』替换掉;
5、保存文件,再次运行程序错误或警告就消失了;

建议:
在公司开发环境下不要用 Beta 版本的程序进行开发,包括操作系统,都会引起很多不必要和莫名其妙的问题,亲身体验,不作死就不会死,血与泪的教训。


Xcode7 Beta4 版本创建 HTTP 请求应用的时候出现
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
Google后查证,iOS9引入了新特性App Transport Security (ATS)。
新特性要求App内访问的网络必须使用HTTPS协议。
但是现在公司的项目使用的是HTTP协议,使用私有加密方式保证数据安全。现在也不能马上改成HTTPS协议传输。

解决方法:
1、在 Info.plist 中添加 NSAppTransportSecurity类型Dictionary。
2、在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES

原文地址:https://www.cnblogs.com/tate-zwt/p/4814806.html