Re: An Array of structs

Hamish Allan <[email protected]>
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
On Fri, Nov 27, 2009 at 12:16 PM, Christiaan Hofman <[email protected]> wrote:

> Well, the error says it all: you can only use constants to initialize a global variable. testy is a variable, not a constant, while @"testy" is a constant. If you want to initialize a global variable using a non-constant  variable, you should do that in an initializer like +initialize or +load.

Or if you want the compiler to recognise your variable as constant,
you can mark it as such:

const NSString *const testy = @"testy";

Hamish
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.