I\'ve got the following in my .h file:
#ifndef _BALANCE_NOTIFICATION
#define _BALANCE NOTIFICATION
const NSString *BalanceUpdateNotification
#endif
>
Typically you declare the variable as extern in the header. The most idiomatic way seems to be like this:
#ifndef __HEADER_H__
#define __HEADER_H__
extern NSString * const BalanceUpdateNotification;
#endif
#include "header.h"
NSString * const BalanceUpdateNotification = @"BalanceUpdateNotification";
extern tells the compiler that something of type NSString * const by the name of BalanceUpdateNotification exists somewhere. It could be in the source file that includes the header, but maybe not. It is not the compiler's job to ensure that it does exist, only that you are using it appropriately according to how you typed it. It is the linkers job to make sure that BalanceUpdateNotification actually has been defined somewhere, and only once.
Putting the const after the * means you can't reassign BalanceUpdateNotification to point to a different NSString.