“extern const” vs “extern” only
I've seen 2 ways of creating global variables, what's the difference, and when do you use each? //.h extern NSString * const MyConstant; //.m NSString * const MyConstant = @"MyConstant"; and //.h extern NSString *MyConstant; //.m NSString *MyConstant = @"MyConstant"; the former is ideal for constants because the string it points to cannot be changed: //.h extern NSString * const MyConstant; //.m NSString * const MyConstant = @"MyConstant"; ... MyConstant = @"Bad Stuff"; // << YAY! compiler error and //.h extern NSString *MyConstant; //.m NSString *MyConstant = @"MyConstant"; ... MyConstant = @