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