In C, the static used outside a function is used to declare a character that will only be accessible from the file in which it was declared. Type of "private" global variables.
The keyword const means "constant." Read, the value cannot be changed. Note that the two statements are different:
const int * x; int * const x;
The first defines a pointer to a constant integer (its value cannot be changed, but it can point to something else). The second defines a constant pointer to an integer (the value of the pointer cannot be changed, but the value of int can be). So you can perfectly:
const int * const x;
So in your case:
static NSString* kFetcherCallbackThreadKey = @"_callbackThread";
Pointer to an instance of NSString that will be available only from the file in which it was declared.
static NSString* const kFetcherCallbackRunLoopModesKey = @"_runLoopModes";
A constant pointer to an instance of NSString, which will be available only from the file in which it was declared.
NSString* const kFetcherRetryInvocationKey = @"_retryInvocation";
A constant pointer to an instance of NSString, which can be accessed from other files in your project.
static const NSUInteger kMaxNumberOfNextLinksFollowed = 25;
A constant that will be available only from the file in which it was declared.
Macmade
source share