I keep reading different things about this and it seems dangerously confusing. Can someone please tell me the proper pattern to define notification strings that can be used globally? Everything I've tried have caused linker errors. For example, in my GlobalVariables singleton I added:
#import <Foundation/Foundation.h>
extern NSString *kMPTimeChanged;
@interface GlobalVariables : NSObject etc.
And then in the init:
@implementation GlobalVariables
#pragma mark Singleton Methods
+ (id)sharedGlobals {
static GlobalVariables *sharedGlobals = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedGlobals = [[self alloc] init];
});
return sharedGlobals;
}
- (id)init {
if (self = [super init]) {
kMPTimeChanged=@"kMPTimeChanged";
return self;
}
It didn't build, I got multiple errors.