一、項(xiàng)目運(yùn)行不了
Failed to initiate service connection to simulator Error returned in reply: Connection invalid

image.png
解決辦法:需要關(guān)閉所有不同版本的xcode還有模擬器,重新打開運(yùn)行就行
二、添加文件或者第三方庫出錯(cuò)
linker command failed with exit code 1 (use -v to see invocation)
1、首先排查項(xiàng)目中是否有名字重復(fù)的文件;
結(jié)合我的以上的報(bào)錯(cuò)情況,查看項(xiàng)目中是否不止一個(gè)ViewController文件
2、檢查是否在#import頭文件的時(shí)候,錯(cuò)把.h寫成了.m
通過Xcode的過濾查詢功能,我很很快就修正了錯(cuò)誤。
三、引入ARC庫
iOS 報(bào)錯(cuò):cannot create weak reference in file using
解決辦法:
點(diǎn)擊工程啟動(dòng)文件 - TARGETS -Build Settings - 在下方搜索框搜索weak - 在Apple LLVM 8.0 - Language - Objective C選項(xiàng)下邊 - 把Weak Reference in Manual Retain Release選項(xiàng)改成YES即可。

image.png