Re: String Constants the solution

2012-03-14 Thread Jens Alfke
On Mar 14, 2012, at 1:12 AM, Andreas Grosam wrote: > The more OO like approach is to create corresponding sub subclasses for class > "Transport", e.g. AirTransport, GroundTransport, and possibly a factory class > which creates such instances. Yup. I’ve learned over time that “switch(something-

Re: String Constants the solution

2012-03-14 Thread Andreas Grosam
On Mar 9, 2012, at 1:29 AM, Prime Coderama wrote: > I have references to 'ground' and 'air' in multiple files. It is usually used > in this context, but not always. >> if ([transport.type isEqualToString:@"ground"]) { >>// do something for automobiles >> } >> else if ([transport.type isEq

Re: String Constants the solution

2012-03-13 Thread William Squires
I just do a #define in the header like #define kDictionayKey1 @"key1" #define kDictionaryKey2 @"key2" then use it somewhere in the .m file foo = [myDic objectForKey:kDictionaryKey1]; and so on... On Mar 8, 2012, at 6:29 PM, Prime Coderama wrote: > I have references to 'ground' and 'air' in mu

Re: String Constants the solution

2012-03-08 Thread Eeyore
On Mar 8, 2012, at 4:29 PM, Prime Coderama wrote: > I have references to 'ground' and 'air' in multiple files. It is usually used > in this context, but not always. >> if ([transport.type isEqualToString:@"ground"]) { >>// do something for automobiles >> } >> else if ([transport.type isEq

String Constants the solution

2012-03-08 Thread Prime Coderama
I have references to 'ground' and 'air' in multiple files. It is usually used in this context, but not always. > if ([transport.type isEqualToString:@"ground"]) { > // do something for automobiles > } > else if ([transport.type isEqualToString:@"air"]) { > // do something else for pl