天天看點

解決 CoreData 報錯 linker command failed with exit code 1 (use -v to see invocation)

問題原因

在內建CoreData技術棧堆添加 Entity 之後點 Editor –> Create NSManegedObject Subclass

解決 CoreData 報錯 linker command failed with exit code 1 (use -v to see invocation)

編譯時候, 報

clang: error: linker command failed with exit code 1 (use -v to see invocation)

這是由于Xcode在自動生成:

Person+CoreDataClass.h

Person+CoreDataClass.m

Person+CoreDataProperties.h

Person+CoreDataProperties.m

這四個檔案的時候, 頭檔案循環導入了:

解決 CoreData 報錯 linker command failed with exit code 1 (use -v to see invocation)
解決 CoreData 報錯 linker command failed with exit code 1 (use -v to see invocation)
解決

令生成的兩個 .m 檔案其中一個不編譯就可以了

解決 CoreData 報錯 linker command failed with exit code 1 (use -v to see invocation)

繼續閱讀