[Biococoa-dev] string definitions

Koen van der Drift kvddrift at earthlink.net
Mon Mar 21 06:39:49 EST 2005

On Mar 21, 2005, at 12:42 AM, Charles PARNOT wrote:

> You can't define the value of a variable in a header and then call 
> that header from multiple file. Otherwise, the compiler creates one 
> variable for each implementation file and each compiled '.o' piece of 
> code. What you are supposed to do is declare those variables in the 
> header using extern, so the linker knows that these variables will 
> exist. And then the values should be set in an implementation file. 
> Constants have to be associated with one particular class. It should 
> probably be in BCSymbol.m.
> So the header should have
> extern NSString *BCSymbolNameProperty;
> and the implementation
> NSString *BCSymbolNameProperty=@"Name";

Well then that would defeat the purpose of one central file with all 
the strings defines, some of which might occur in more than one file. 
Maybe there is another construction possible to do such a thing?


- Koen.

More information about the Biococoa-dev mailing list