Linker error on const values

I am trying to create some string constants so I have the following:

Constants.h

extern NSString* const CONSTANT_ONE;

Constants.m

NSString *const CONSTANT_ONE = @"CONSTANT_ONE";

SomeOtherFile.m

#import "Constants.h"
... snip
NSString* something = CONSTANT_ONE;

Constants.m is listed in the "Compile Sources" bit of the target's build phases and is a member of the target when I look in its "Target Membership" section of the sidebar.

When I try to compile I get an error like:

Undefined symbols for architecture i386:
  "_CONSTANT_ONE", referenced from:
      -[SomeOtherFile someMethod:] in SomeOtherFile.o

I think I might be misunderstanding something basic here - can anyone help me with this error please?

Answers


The code in my initial question was correct. I don't know why but simply closing and re-opening Xcode solved the problem and it built fine. Just Xcode getting itself confused.


Need Your Help

Apply ng-repeat on bootstrap row

angularjs twitter-bootstrap angularjs-ng-repeat

I'm trying to apply ng-repeat to the cols here marked with the class "company". I'm unable to do so because "row" breaks the sequence in between.

Button for backspace for calculator in Android

android calculator

I'm developing a calculator in which I want to add a backspace button. On clicking on backspace button elements of EditText will be delete one-by-one. But I'm not getting how to write the code for ...