iOS开发之一些错误集锦
No1.
NSAutoreleasePool' is unavailable: not available in automatic reference counting mode
答:根据Objective-C 2.0程序设计上的旧版本的代码会发生NSAutoreleasePool' is unavailable: not available in automatic reference counting mode的错误
需要手动关闭工程中ARC
工程中 Build Settings--->Apple LLVM compiler 3.0 - Language--->Objective-C Automatic Reference Counting 把YES改为NO就可以了
然后就可以编译通过了
No2.
5 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1

这个例子意思是引用了重复的文件,接下来你要到
Build Phases --> Compile Sources --> Filter -->搜索你报错的controller或者其他

搜索那个报错的提示的地方(Controller,View 等),如果有两个删除它,删除之后不要着急,先运行一下,如果运行之后又新报了两个错误,你再在这个地方搜索一下,看看删除的那个存不存在,如果不存在,就再添加一下,再运行就没问题啦
NO3.
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_DHServiceWorkingHandler", referenced from:
objc-class-ref in DHLoginViewModel.o

这个问题其实是因为没导入DHServiceWorkingHandler这个文件
TARGETS --> Build Phases --> Compile Sources --> 点击+ 添加就可以了
还有一种可能就是少加了一个静态库,如果报错的都属于同一个文件,那就把它对应的总的加进去

No4.
同步代码出现:“couldn't load project”
在这个工程当前目录下
- 找到 xxxx.xcodeproj
- 显示包内容
- 打开project.pbxproj
- 搜索这个文件里的 ====
- 解决冲突重新运行就可以了
No5.
"OBJC_CLASS$xxxxxx", referenced from: objc-class-ref in xxxx.

Target Members 如果没有连接,就连接上,然后再编译
No6.
textField不能输入的问题
1.如果是加在图片上的话打开图片的交互
2设置[textfield becomeFirstResponse]
No7.
错误:7 duplicate symbols for architecture x86_64
查看工程中是否有重复文件
No.8
Failed to chmod /Users/peiyunchen/Library/Developer/CoreSimulator/Devices/F8EEA6D0-0CE4-4F38-A1AC-D0B5A8F309E2/data/Library/Caches/com.apple.containermanagerd/Bundle/Application/C315833E-E912-4223-BB30-F052647E6D96/DHProject_IPad.app/DHProject_IPad : No such file or directory
重启一下模拟器或者xcode试一下就好了
#######
(os/kern) invalid capability (20)

ld: embedded dylibs/frameworks are only supported on iOS 8.0 and later (@rpath/Hyphenate.framework/Hyphenate) for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
文件中有c或者c++的文件,选中当前c/c++的文件,改成object-c source

########
Reason: image not found XXXX(这个是我手动导入环信出现的问题)
把在黄箭头导入的同样也导入到红箭头的地方就好了
