I\'m developing a Cocoa application, and I\'m using constant NSString
s as ways to store key names for my preferences.
I understand this is a good idea b
Easiest way:
// Prefs.h
#define PREFS_MY_CONSTANT @"prefs_my_constant"
Better way:
// Prefs.h
extern NSString * const PREFS_MY_CONSTANT;
// Prefs.m
NSString * const PREFS_MY_CONSTANT = @"prefs_my_constant";
One benefit of the second is that changing the value of a constant does not cause a rebuild of your entire program.