Re: Defining and using constants in Objective C

2009-11-30 Thread Ken Thomases
On Nov 30, 2009, at 12:41 AM, Kenny Leung wrote: - Constants.h --- extern const NSString *Suction; - Constants.m --- const NSString *Suction = @"Ball"; That should be: extern NSString* const Suction; and: NSString* const Suction = @"Ball"; Th

Re: Defining and using constants in Objective C

2009-11-29 Thread Kenny Leung
Hi Tharindu. I would create two files: Constants.h and Constants.m. Just like all C code, you put your declarations in the .h and the definitions in the .m. They are going to be very similar, except the .m defines the values, so it only happens once. This is very important if you want to be abl

Re: Defining and using constants in Objective C

2009-11-29 Thread Jens Alfke
On Nov 29, 2009, at 9:30 AM, Tharindu Madushanka wrote: > When defining constants can I keep all important constants in one file and > use it all over the application, rather defining same constant in several .m > files. This might be a basic question, but just could not figure out how to > do th

Re: Defining and using constants in Objective C

2009-11-29 Thread Nick Zitzmann
On Nov 29, 2009, at 10:30 AM, Tharindu Madushanka wrote: > When defining constants can I keep all important constants in one file and > use it all over the application, rather defining same constant in several .m > files. Of course. You don't need to define classes or functions in source files,

Defining and using constants in Objective C

2009-11-29 Thread Tharindu Madushanka
Hi When defining constants can I keep all important constants in one file and use it all over the application, rather defining same constant in several .m files. This might be a basic question, but just could not figure out how to do this. Thank you Tharindu Madushanka ___