IOS 之错误记录

1、相机权限:This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

  • https://blog.csdn.net/qq_39097425/article/details/88985484
  • 在 info.plist 添加键值对 “Privacy - Camera Usage Description” —— YES(值不能为空,随便填个值就行)在这里插入图片描述

2、Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window.

  • 问题:
  • 1、iPhone 系统版本12.1.2,Xcode 13.1。运行代码显示iPhone’s iOS 12.1.2 doesn’t match Playza.app’s iOS 13.0 deployment target
  • 2、升级 iPhone 系统版本到最新版本15.3.1后,运行代码显示Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window.
  • 3、在 Xcode 中快捷键 command + shift + 2,显示Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window. Failed to prepare device for development
    4、搜索网上资料,在stackoverflow网站上发现有前辈遇上到同样的问题组合(iPhone 15.3.1 + Xcode 13.1),对方将 Xcode 升级为 13.2 解决问题。但因为约定 Xcode 版本需要统一进行升级,故换了一部低于 15.3.1 版本的手机。
    Xcode error: Failed to prepare device for development

3、‘statusBarOrientation’ was deprecated in iOS 13.0: Use the interfaceOrientation property of the window scene instead.

extension UIWindow {
  static var isLandScape: Bool {
    if #available(iOS 13.0, *) {
      return UIApplication.shared.windows
        .first?
        .windowScene?
        .interfaceOrientation
        .isLandscape ?? false
    } else {
      return UIApplication.shared.statusBarOrientation.isLandscape
    }
  }
}

4、DYLD_LIBRARY_PATH=/usr/lib/system/introspection,DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecordin

5、where clauses are preferred over a single if inside a for. (for_where)

参考资料


未完待续…

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值