-1

I am getting the following error whenever I am making the new project. On changing the Enable Bit Code to No the error is going.

But once I design my main story board i.e. add table view controller and navigation controller to main story board above error is coming again.

I am posting screen shots of the error and my build settings.enter image description here

Tushar
  • 129
  • 1
  • 2
  • 10
  • Check out the following link: http://stackoverflow.com/q/26772504/3397217 – LinusGeffarth Nov 26 '15 at 16:54
  • It says you have a duplicated symbol called storedObject in `HomeTableViewController` and `StoreDetailTableViewController`.. can you tell us what is defined as storedObject inside those 2 view controllers? – Marc-Alexandre Bérubé Nov 26 '15 at 20:19
  • My storeObject is static and now I am now giving different names to these objects in each file – Tushar Nov 28 '15 at 21:25

1 Answers1

0

I found this Apple Support thread that might help, here is what the answer says:

I'm guessing it was because you have duplicate symbols. It is probably something defined in a header file that should be in a source file

So here are several things that might be causing the issue:

  • You are importing a .m file, only import .h files
  • If you have an @implementation in a header file, those only go in the implementation file.
  • You might have a .m file that is included twice. Leave only one file reference.

enter image description here

You would be able to see them in the Build Phases, see image

  • There might be a declaration above the @Interface in the .h file, put it in the @Interface
  • Declaring a constant or variable in different .h files with the same name.
  • Changing 'No Common Blocks' from Yes to No might help (under Targets->Build Settings->Apple LLVM - Code Generation)

  • This could happen also when you have the same @interface in different files with different implementations. For example you have a Player class, in the Player.h/m files and you have a Match class (Match.h/m), and a match is between two player, but not the aforementioned Player.

Player.h

@interface Player : NSObject
@property (nonatomic) NSUInteger _id;
@property (nonatomic, strong) NSString* firstName;
@property (nonatomic, strong) NSString* lastName;
@property (nonatomic, strong) NSString* username;
@end

Match.h

@class Player

@interface Match : NSObject
@property (nonatomic, strong) Player* player1;
@property (nonatomic, strong) Player* player2;
@property (nonatomic) NSUInteger matchId;
@end

@interface Player : NSObject
@property (nonatomic, strong) NSString* nickName;
@property (nonatomic, strong) NSString* point;
@property (nonatomic, strong) NSNumber* lastMove;
@end

In this case the the compiler see two different Player class implementation. You need to refactor the Player class in the Match.h file to MatchPlayer.

Caleb Kleveter
  • 11,170
  • 8
  • 62
  • 92