I had a class called ReportsViewController in my iPhone app. I wanted to restore it form an older version of the class which I had copied to a text file. I copied and pasted the whole thing, and now everything is going wrong. I get the following error:
ld: duplicate symbol _OBJC_METACLASS_$_ReportsViewControllers in /Users/myname/Library/Developer/Xcode/DerivedData/TestGA-gipaszaocsrbkwashqjghthtsoda/Build开发者_如何学Python/Intermediates/TestGA.build/Release-iphoneos/TestGA.build/Objects-normal/armv6/ReportsViewControllers.o and /Users/myname/Library/Developer/Xcode/DerivedData/TestGA-gipaszaocsrbkwashqjghthtsoda/Build/Intermediates/TestGA.build/Release-iphoneos/TestGA.build/Objects-normal/armv6/MasterGA.o for architecture armv6
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
How can I fix this?
Judging by the error, you've got two declarations of ReportsViewControllers
. You need to find the one that you don't want and delete it.
Either there are two class-files or you "dubble-pasted" it, means there are two @implementaion MyController
精彩评论