0
votes

i create a new project with single page application, then i removed ViewController.h and .m file also deleted my story boards because i wanted to make a new class with UITableView subclass, after i build new storyBoard and changed the Main storyboard file base name in info.plist file to the new storyboard then i've got this error:

Apple Mach-O Linker Error Group clang: error: linker command failed with exit code 1 (use -v to see invocation)

enter image description here

can anyone help me with it?

i figured out something, when i create NSManagedSubclass from my .xcdatamodeld core data file, it make 4 sub class for each entity like the pictur below:

enter image description here

and thats where the problem will create, i read that the problem is dublicate file, maybe duplicate #import syntax, i dont know how to fix this i tried to fix it by put the 2 .h file for each entity together but it didnt work and i've got more errors, so i appreciate if you guys help me.

this is the log:

duplicate symbol _OBJC_CLASS_$_Note in: /Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejleziaoxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Note+CoreDataClass.o duplicate symbol _OBJC_METACLASS_$_Note in: /Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejleziaoxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Note+CoreDataClass.o duplicate symbol _OBJC_CLASS_$_Setting in: /Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejleziaoxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Setting+CoreDataClass.o duplicate symbol _OBJC_METACLASS_$_Setting in: /Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejleziaoxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Setting+CoreDataClass.o ld: 4 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

3

3 Answers

1
votes

Follow carefully the instructions in this Technical Q&A. I think you might have not done step 2 in the first figure, where you need to select "Manual/None" in the "Codegen" dropdown.

0
votes

Below solutions might work.

  1. Try to find if there is any place where you have imported .m instead of .h file

  2. if you are using cocoa pods then open .xcworkspace instead of .xcodeproj file

Here are some useful links for this kind of errors

Apple Mach-O Linker & Ditto Error - Xcode 8

Apple Mach-O Linker Error when compiling for device

-1
votes

Navigate to Build Phases in Xcode, then try to find if there were duplicated files in Compile Sources.

Hope that would hep you