我知道这个问题曾经被问过很多次,但是现在没有人解决了我的问题。我知道在项目中有多个文件副本时会发生此错误。
我试图清理生成,删除“编译源”中的所有LoginController.m文件,然后生成。很好-没有错误。当我在Complie资源中添加LoginController.m文件时,编译器再次给出了相同的错误。

接下来,我尝试从编译源中删除所有.m文件,成功清理并重建,并非常小心地添加了每个.m文件。同样出现了同样的错误。我没有找到任何重复的文件,那为什么会发生这种情况呢?

请有人指导我。非常感谢。

编辑:
错误是:
Ld /Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Products/Debug-iphonesimulator/TryAgain.app/TryAgain normal i386 cd /Users/svp/Desktop/TryAgain setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Products/Debug-iphonesimulator -L/Users/svp/Desktop/TryAgain/TryAgain -L/Users/svp/Desktop/TryAgain/../CorePlot_1.0/Binaries/iOS -F/Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Products/Debug-iphonesimulator -filelist /Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Intermediates/TryAgain.build/Debug-iphonesimulator/TryAgain.build/Objects-normal/i386/TryAgain.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -all_load -fobjc-arc -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework MediaPlayer -lz -framework AVFoundation -framework MobileCoreServices -framework SystemConfiguration -framework CFNetwork -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -lCorePlot-CocoaTouch -o /Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Products/Debug-iphonesimulator/TryAgain.app/TryAgainld: duplicate symbol _OBJC_CLASS_$_LoginController in /Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Intermediates/TryAgain.build/Debug-iphonesimulator/TryAgain.build/Objects-normal/i386/LoginController.o and /Users/svp/Library/Developer/Xcode/DerivedData/TryAgain-dhbbyywxclvxfodbunqysmmfefcl/Build/Intermediates/TryAgain.build/Debug-iphonesimulator/TryAgain.build/Objects-normal/i386/Navigator.o for architecture i386Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1

最佳答案

您的错误消息说,从LoginController.m和Navigator.m创建的二进制文件都为LoginController类定义了一个实现。有时,这是由于包含实现逻辑的共享头文件引起的。检查您的Navigator.h/.m以获得对LoginController的引用。

10-08 07:20