IOS端xcode编译bug修复

IOS端写demo打bug记

BUG甲

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.
解决方案:
在这里插入图片描述
滑动到最后一个 item 会出现一个小加号,输入 Privacy 可以迅速定位到这一权限系列,找到你需要的权限,修改后面的 value 就可以了
当然也可以用如下方法添加:
1.在项目中找到info.plist文件,右键点击以 Source Code形式打开
2.添加以下键值对,这里以 PhotoLibrary 作为例子
NSPhotoLibraryUsageDescription
此 App 需要您的同意才能读取媒体资料库

BUG乙

Xcode setting ENABLE_BITCODE的问题
在这里插入图片描述
解决方案:就在图示的地方改一下就可以了。

BUG丙

“this class is not key value coding-compliant for the key xxx.”问题
解决方案:
这个报错表示IBOutlet或IBAction的设定有问题,因此重新设定即可。我是把所有的这些关联都删除掉,重新捋了一遍就可以了。我看了一下主要还是因为多次重复的拉关联,导致的这个问题。

Warning甲

Null passed to a callee that requires a non-null argument
此警告就是某属性说好的不能为空,你又在某地方写了XX = nil 所以冲突了
解决方案:
在声明一个属性的时候加上nullable就可以了
@property (nonatomic, copy, nullable) NSString tickets;

Warning乙

The iOS Simulator deployment target is set to x.x, but the range of supported deployment target versions for this platform is 8.0 to 12.0. (in target ‘xxx’)
解决方案:
在podfile后添加

post_install do |installer|
  installer.pods_project.targets.each do |target|
 target.build_configurations.each do |config|
  if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 8.0
    config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
   end
  end
 end
end

即可

Warning丙

_____ is deprecated: first deprecated in iOS 12.0 - OpenGLES API deprecated. (Define GLES_SILENCE_DEPRECATION to silence these warnings)_
解决方案:在预处理宏中添加GLES_SILENCE_DEPRECATION=1即可

Warning丁

Sending ‘ViewController *const __strong’ to parameter of incompatible type ‘id<某Delegate>’
解决方案:只需要在@interface 控制器名 后面加上<协议名>即可

Warning戊

处理完丁以后,出现Class ‘AudioVideoView’ does not conform to protocol ‘某Delegate’
这是因为要实现该Delegate的功能,但是这里没有实现,所以出现警告。
解决方案:实现Delegate的功能,但是如果不需要这里面的功能的话,不实现也行。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

sheldonma

感谢大佬赏饭

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值