#import
extern NSString * const BaseURL;
@interface ClassName : NSObject {
You will then need to set it's value in your main .m file as follows:
#import "ClassName.h"
NSString * const BaseURL = @"http://some.url.com/path/";
@implementation ClassName
You can now access this constant throughout your class or subclasses. Here's an example of usage:
NSString *urlString = [NSString stringWithFormat:@"%@%@", BaseURL, @"filename.html"];
No comments:
Post a Comment