I'm not sure what I did but I added an IBOutlet to display an additional attribute in a TableView cell. When building the application I get the following error message...
Ld /Users/roberthill/Library/Developer/Xcode/DerivedData/PHAInspect-awfhtfopjdgfmsdsjfjivdnlzgir/Build/Products/Debug-iphonesimulator/PHAInspect.app/PHAInspect normal i386
cd /Users/roberthill/Documents/PHAInspect
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/roberthill/Library/Developer/Xcode/DerivedData/PHAInspect-awfhtfopjdgfmsdsjfjivdnlzgir/Build/Products/Debug-iphonesimulator -F/Users/roberthill/Library/Developer/Xcode/DerivedData/PHAInspect-awfhtfopjdgfmsdsjfjivdnlzgir/Build/Products/Debug-iphonesimulator -filelist /Users/roberthill/Library/Developer/Xcode/DerivedData/PHAInspect-awfhtfopjdgfmsdsjfjivdnlzgir/Build/Intermediates/PHAInspect.build/Debug-iphonesimulator/PHAInspect.build/Objects-normal/i386/PHAInspect.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework CoreData -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/roberthill/Library/Developer/Xcode/DerivedData/PHAInspect-awfhtfopjdgfmsdsjfjivdnlzgir/Build/Products/Debug-iphonesimulator/PHAInspect.app/PHAInspect
ld: duplicate symbol _OBJC_METACLASS_$_Inspection in /Users/roberthill/Library/Developer/Xcode/DerivedData/PHAInspect-awfhtfopjdgfmsdsjfjivdnlzgir/Build/Intermediates/PHAInspect.build/Debug-iphonesimulator/PHAInspect.build/Objects-normal/i386/Inspection-AEDA73D75B42426A.o and /Users/roberthill/Library/Developer/Xcode/DerivedData/PHAInspect-awfhtfopjdgfmsdsjfjivdnlzgir/Build/Intermediates/PHAInspect.build/Debug-iphonesimulator/PHAInspect.build/Objects-normal/i386/Inspection-AEDA73D75B42426A.o for architecture i386
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
I tried backing out the changes to add the IBOutlet but I'm still getting this error message.
I checked other similar posts but I don't think the conditions are the same (I could be wrong though). Any ideas?
In my first app, I had this problem after replacing a class. As I didn't want to delete the old class completely, I moved it to another group, still within xcode. xcode tries to compile two copies of this class, causing the error. Deleting the references to the old class from the project fixed my problem.
Upvote went to quarac, who made this easier for me to spot.
If more than one class shares a same name this kind of error will come
I dont really understand why this would be a problem so maybe someone could clarify but for me the problem was that I had imported another class which had declared an instance variable with the same name as one in the current class.
When I changed the name of the ivar in the imported class's implementation the error disappeared.
Hope this helps!
Other than the .m issue, if you created models in the wrong folder, deleted them and then created/replaced the models in the correct folder. You may need to remove the duplicates in Targets Build Phases under the Compiled Sources grouping.
Not sure, but a silly question - did you do a clean after clearing the old code? Sometimes that stuff hangs around.
This may happen also if you have constant definitions with the same name in two different classes. In my case it was a boolean flag like these:
Class A:
Class B:
I just had to change the constant definition on the second class to: