iOS-我遇到的问题(三)

报错:

library not found for -lstdc++.6.0.9
linker command failed with exit code 1 (use -v to see invocation)

拷贝缺失的libstdc++

XCode10目前是Beta版,和XCode9正式版可以共存,于是从XCode9的目录里,把缺失的.tbd文件拷贝过来,要记得拷贝2套,一套是模拟器的,一套是设备的,可以简单的用下面的命令

cp /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libstdc++.* /Applications/Xcode-beta10.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
cp /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libstdc++.* /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

报错:

:-1: Multiple commands produce '/Users/xxx/Library/Developer/Xcode/DerivedData/xxx.app/cmath':
1) Target 'KingDraw' has copy command from '/Users/goodsrc/Desktop/公司项目/xxx/xxx/GKDLib/RDLib/include/boost/compatibility/cpp_c_headers/cmath' to '/Users/xxx/Library/Developer/Xcode/DerivedData/xxx.app/cmath'
2) Target 'xxx' has copy command from '/Users/xxx/Desktop/公司项目/xxx/GKDLib/RDLib/include/boost/tr1/tr1/cmath' to '/Users/xxx/Library/Developer/Xcode/DerivedData/xxx.app/cmath'

解决办法

第一种. 删除多余的或者改名字
第二种. 修改Xcode编译配置Xcode->File->Project Settings/Workspace Setting-> Build System -> Legacy Build System.

    1. git更新,缺失文件

报错:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_ChangePasswordController", referenced from:
      objc-class-ref in SidebarController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

解决办法

git拉取代码时,ChangePasswordController.h文件更新到文件夹中,但是在Xcode文件列表中并没有ChangePasswordController.h这个文件

    1. 便利数组的同时又修改这个数组里面的内容,导致崩溃

报错:

Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSArrayM: 0x282112430> was mutated while being enumerated.'

解决办法

forin循环遍历可变数组,并对其进行增删操作。
使用enumerateObjectsUsingBlock遍历对可变数组进行增删操作

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Swift1> Swift和OC的区别1.1> Swift没有地址/指针的概念1.2> 泛型1.3> 类型严谨 对...
    cosWriter阅读 11,136评论 1 32
  • 1 如图: 解决方案:只需要在引用处导入 #import 即可 2 如图: 原因1. 是提示的png并不是ps...
    街角仰望阅读 5,613评论 0 5
  • 2018.4.16复盘Days126章孝萍 今天没有在纸上写出三个目标,早起时有其它事情搁着,心里一直放不下,...
    章孝萍阅读 102评论 0 0
  • 不大的客厅里坐着我的两位姑姑、一位姑爷、我还有豆豆。豆豆是我姑家养的一只泰迪狗。我第一次见到豆豆的时候,它不停的狂...
    美人鱼的尾巴阅读 150评论 0 0
  • 在旁人眼里,创业者都是拼命三郎,天天打了鸡血,精力无穷。曾经有一个照明行业的上市公司老总跟我说,创业20多年来,从...
    壹诧阅读 356评论 0 2