1

我目前正在学习如何使用 Objective-C 我正在做一个涉及类的简单项目,我决定将它放入 Xcode 中进行一些简单的可视化调试,但是在消除所有错误和警告后,我遇到了

duplicate symbol _OBJC_IVAR_$_Customer._fName in:
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/main.o
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/NRaI.o
duplicate symbol _OBJC_IVAR_$_Customer._lName in:
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/main.o
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/NRaI.o
duplicate symbol _OBJC_IVAR_$_Customer._age in:
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/main.o
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/NRaI.o
duplicate symbol _OBJC_IVAR_$_Customer._rank in:
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/main.o
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/NRaI.o
duplicate symbol _OBJC_IVAR_$_Customer._intention in:
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/main.o
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/NRaI.o
duplicate symbol _OBJC_METACLASS_$_Customer in:
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/main.o
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/NRaI.o
duplicate symbol _OBJC_CLASS_$_Customer in:
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/main.o
/Users/Slench/Library/Developer/Xcode/DerivedData/NameRankIntention-hlaqvlslfjimqdeysxqiyloirdus/Build/Intermediates/NameRankIntention.build/Debug/NameRankIntention.build/Objects-normal/x86_64/NRaI.o
ld: 7 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

现在奇怪的是,我将“固定代码”放回 Sublime Text 中,在那里我保存了它,然后通过终端编译它,它工作得很好没有错误没有警告什么都没有

我已经阅读了有关此的其他一些问题,解决方案要么始终是他们找到了重复声明,要么他们有一个同名的额外文件导致重复声明......我都没有。 ..

所以……有什么帮助吗?

4

1 回答 1

1

您是否可能无意中在 main.m 中导入了“NRaI.m”文件?

于 2012-08-08T20:17:43.867 回答