Possible duplicate:
Constants in Objective-C
I am designing a controller and I need some constants inside it (locally, only for this controller). Looking at the sample code provided by Apple, I see these lines:
#import "Constants.h" #define kTextFieldWidth 260.0 static NSString *kSectionTitleKey = @"sectionTitleKey"; static NSString *kSourceKey = @"sourceKey"; static NSString *kViewKey = @"viewKey"; const NSInteger kViewTag = 1;
Can someone explain to me what is the difference between the two? What style should I use? Are they dependent on the type of object / value you assign to them? The value is used: static NSString * for strings, #define for float, and NSInteger for integers? How do you make a choice?
Hidden
source share