ios9和xcode7的适配问题

 

  1、ios9 bitcode设置问题
首先最大的问题就是坑货xcode7,xcode7默认是打开bitcode的,bitcode是苹果为了解决他本身之后的应用能够随意更换硬件的处理作的准备也就是arm指令集和x64指令集的问题

那么咱们的工程若是你采用了别人封装的第三方库,那么好了,会爆如下错误
ld: ‘/UsersFramework/SDKs/PolymerPay/Library/mobStat/lib**SDK.a(**ForSDK.o)’does not contain bitcode. You must rebuild it with bitcode enabled (Xcodesetting ENABLE_BITCODE), obtain an updated library from the vendor, or disablebitcode for this target. for architecture arm64

上述这段文字说明了咱们的第三方库不支持bitcode,若是你须要支持,就须要这个第三方库也支持bitcode。苹果目前给出的临时解决方案就比如当 初MRC和ARC时候的解决办法,当初xcode5更新时候默认是工程建立是ARC的,你能够关闭ARC改成MRC,通过了一段时间后,你们都开始使用了 ARC,那么bitcode也同样,在xcode7时候默认是开启的,咱们须要关闭,那么如何关闭 以下图:
在targets里面选择BuildSetting中搜索bitcode,将对应的Yes 改为对应的No。
 
  2、iOS9 https问题
若是在Xcode 9以前使用的时http请求,那么在XCode 9上编译的App是不能联网的,会提示以下错误:
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.
修 改方法是要么使服务器支持https访问,要么关闭https的使用。第一种方法对于我的开发者来讲代价仍是比较大的,所以推荐使用后面一种方法,具体的 作法是:在工程的Info.plist文件里添加NSAppTransportSecurity字典类型的,添加一个元素:key为 NSAllowsArbitraryLoads,值为YES。 以下图:
 

3、iOS 9 使用URL scheme必须将其加入白名单(摘抄)
在使用URL scheme的时候,在ios9上面,若是不加白名单的话  应用会找不到对应的app。

受此影响,当你的应用在iOS 9中须要使用 QQ/QQ空间/支付宝/微信SDK 的相关能力(分享、收藏、支付、登陆等)时,须要在“Info.plist”里增长以下代码:ios

<key>LSApplicationQueriesSchemes</key> <array> <!-- 微信 URL Scheme 白名单--> <string>wechat</string> <string>weixin</string> <!-- 新浪微博 URL Scheme 白名单--> <string>sinaweibohd</string> <string>sinaweibo</string> <string>sinaweibosso</string> <string>weibosdk</string> <string>weibosdk2.5</string> <!-- QQ、Qzone URL Scheme 白名单--> <string>mqqapi</string> <string>mqq</string> <string>mqqOpensdkSSoLogin</string> <string>mqqconnect</string> <string>mqqopensdkdataline</string> <string>mqqopensdkgrouptribeshare</string> <string>mqqopensdkfriend</string> <string>mqqopensdkapi</string> <string>mqqopensdkapiV2</string> <string>mqqopensdkapiV3</string> <string>mqzoneopensdk</string> <string>wtloginmqq</string> <string>wtloginmqq2</string> <string>mqqwpa</string> <string>mqzone</string> <string>mqzonev2</string> <string>mqzoneshare</string> <string>wtloginqzone</string> <string>mqzonewx</string> <string>mqzoneopensdkapiV2</string> <string>mqzoneopensdkapi19</string> <string>mqzoneopensdkapi</string> <string>mqzoneopensdk</string> <!-- 支付宝 URL Scheme 白名单--> <string>alipay</string> <string>alipayshare</string> </array>

3、新浪微博的jsonkit在部分机型上面致使崩溃(群友Gemini提供)

问题是 程序会奔溃到jsonkit.m void keyObjectISA = ((void **)keys[idx]);这行代码,由于在os x10.10中,NSString采用了TaggedPointer这项技术,此类型不使用解应用isa来获取其所属类,而是经过接下来的三位来查找类表索引的类型,且对象指针最低位置为1。
如何解决:解决方法由群友sun提供参考地址以下
http://blog.csdn.net/woainiliuwei007/article/details/48549103
因为taggedpointer类型不能用isa了,就必须修改成object_getClass(keyObject) ,并且在line:2601处也须要作修改
这里附一个修改过的jsonkit,能够正常使用 
http://download.csdn.net/detail/woainiliuwei007/9123789
四 、原来的dylib后缀名的库所有修改成libz.tbd


5、报错 Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3505.16/UIApplication.m:3294    (群友sun提供) 在Info.plist中,能够找到:“Main storyboard file base name”  String “Main”,删掉这个条目, 再启动,屏幕变成了黑屏 手动添加window - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {     // Override point for customization after application launch.     self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; //全屏window     self.window.backgroundColor = [UIColor whiteColor]; //白色背景     [self.window makeKeyAndVisible]; //     return YES; } ok,这个因为更新xcode7报错已解决! 若是按照上面修改完,发现还在报错,那么去看看你的项目是否是加了引导页 把上面的add方法,变成下面的就好。 这个add方法在xcode7以前是没有问题的,在xcode7后不能这样写了! 
 6、找不到(丢失).dylib文件,换成.tbd文件而又没法运行,请用下面的方式来解决。     1.    Go to Build Phases >Link Binary with Librairies > + > Add other     2.    Once in the file selection window do "CMD"+Shift+G (Go to folder) and type /usr/lib/     3.    From /user/lib you can add : libz.dylib and more...     4.    Compile and have fun
相关文章
相关标签/搜索