I\'ve seen several posts on google and stackoverflow related to this error, I\'ve read all of them but still fetching the problem , I will be glad for a solution. Here is th
Another reason can be that the project is targeted at a simulator instead of a real device when building a distribution-version. That also causes this error message.
I had it where I defined the same C function twice. In two different .m
files. Simply remove one of the definitions and voila.
It was different for me, I copied over the class implementation methods as is and the iVars were also copied over... so in the world of iVars there are two sets and the compiler kept complaining about duplicate ivars before linking the *.o files.
reading the output helped so removed all the duplicating ivars... thanks to the new feature where you need not @synthesize all your properties... the error went away...
Sometimes believe it or not, Xcode screws up the project file. The only solution we found was to manually remove every reference to the offending file using a text editor, then re-add the files in Xcode.
Finally i got the solution-
Linker errors are always showing a problem regarding to a library usage or import issues.
Sometimes the error happens when you have imported a .m file instead of a .h file.
Please check your code and look for a .m import statement in one of your header files (.h extension), I had a similar issue and 14 duplicate symbol error raised.
Check if you have imported ViewControler.m
instead of its .h,So it has to be this way :
import "ViewController.h"
and your AppDelegate.h
should be something like this :
import "UIKit/UIKit.h"
import "ViewController.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong,nonatomic) ViewController *mainController;
@end
Always remember to import header files not a .m