iOS9.0 升级后的常见问题

1,.dylib后缀的库无法导入

ios9 以前的 .dylib后缀的库更改为.tbd


2, iOS9 http 不能请求

iOS9把所有的http请求都改为https了:iOS9系统发送的网络请求将统一使用TLS 1.2 SSL。采用TLS 1.2 协议,目的是 强制增强数据访问安全,而且 系统 Foundation 框架下的相关网络请求,将不再默认使用 Http 等不安全的网络协议,而默认采用 TLS 1.2。服务器因此需要更新,以解析相关数据。如不更新,可通过在 Info.plist 中声明,倒退回不安全的网络请求。

解决的方法可以在Info.plist中添加NSAppTransportSecurity类型Dictionary。 在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES

3,使用第三方SDK总是出现如下问题:


ld:' /用户/ zhusongxiu /下载/ ShareSDKEasyDemo-master / / WeChatConnection ShareSDKEasyDemo / ShareSDK /连接。框架/ WeChatConnection '不包含bitcode。你必须重建它启用了bitcode(Xcode设置ENABLE_BITCODE),从供应商获得一个更新的库,或禁用bitcode这个目标。建筑arm64铿锵声:错误:链接器命令失败,退出码1(使用- v查看调用)

解决办法:(1)重建它启用了bitcode(Xcode设置ENABLE_BITCODE),从供应商获得一个更新的库

   (2)设置  build Settings -> build Options -> Enable botched 为NO


4,Scheme白名单问题(无法判断手机是否安装微信等)

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

搜索后得知

近期苹果公司iOS 9系统策略更新,限制了http协议的访问,此外应用需要在“Info.plist”中将要使用的URL Schemes列为白名单,才可正常检查其他应用是否安装。

受此影响,当你的应用在iOS 9中需要使用微信SDK的相关能力(分享、收藏、支付、登录等)时,需要在“Info.plist”里增加如下相应代码:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>mqqOpensdkSSoLogin</string>
    <string>mqzone</string>
    <string>sinaweibo</string>
    <string>alipayauth</string>
    <string>alipay</string>
    <string>safepay</string>
    <string>mqq</string>
    <string>mqqapi</string>
    <string>mqqopensdkapiV3</string>
    <string>mqqopensdkapiV2</string>
    <string>mqqapiwallet</string>
    <string>mqqwpa</string>
    <string>mqqbrowser</string>
    <string>wtloginmqq2</string>
    <string>weixin</string>
    <string>wechat</string>
</array>

5,项目运行报错如下

<Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
<Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
<Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
在网上查找解决方法,众说纷纭,下面是部分解决方法,我出现的按这样修改也还是没有解决,也有的说这个错误警告是Xcode中的bug,具体情况还未知(下面错误分析,解决方法是看别人说的,仅供参考):

出错原因:设置app的状态栏样式的使用使用了旧的方式,在info.plist里面设置了View controller-based status bar appearance为NO,默认为YES,一般式iOS6的时候使用这种方式,iOS7,8也兼容,但是到了iOS9就报了警告。

[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleLightContent];
以前我们通过上面代码改变状态了颜色,iOS9以后点进去看api发现如下说明
// Setting the statusBarStyle does nothing if your application is using the default UIViewController-based status bar system.
@property(readwrite, nonatomic) UIStatusBarStyle statusBarStyle NS_DEPRECATED_IOS(2_0, 9_0, "Use -[UIViewController preferredStatusBarStyle]");
- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated NS_DEPRECATED_IOS(2_0, 9_0, "Use -[UIViewController preferredStatusBarStyle]");

解决办法:
修改方式将View controller-based status bar appearance设置为YES,然后使用新的方式来实现状态栏的样式

- (UIStatusBarStyle)preferredStatusBarStyle;
- (UIViewController *)childViewControllerForStatusBarStyle;
- (void)setNeedsStatusBarAppearanceUpdate



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值