天天看点

解决 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)

继续阅读