Having just started with Objective-C, this might be a pretty basic question. In objective-c, how can I define constants when extending a default object (say UIViewController). The constant values will then be used by all the objects extending the default object.
One way to do this can be creating categories for the object, something like this...
@implementation UIViewController (Constants)
+ (NSString *)navigationView {
return @"navigationView";
}
+ (NSString *)detailView {
return @"detailView";
}
@end
Would using #define
values in category implementation also work fine for this???
Or may be some better ways are there to do this?