Sometimes I like to browse Apple source code to find out how professionals do it, and sometimes to learn something. I look now in the header file for NSManagedObjectContext.h , and for their global variables, for example NSManagedObjectContextDidSaveNotification , they declare it like this:
COREDATA_EXTERN NSString * const NSManagedObjectContextDidSaveNotification;
then as usual it will be simple:
extern NSString * const NSManagedObjectContextDidSaveNotification
Cmd + clicking COREDATA_EXTERN brings me back to its definition:
#define COREDATA_EXTERN extern
So COREDATA_EXTERN just equal to extern , so my question is, why don't they just use extern ?
source share