When i was going through Singleton design pattern in Objective C, I found lot of people using the below code to create it.
@interface Base : NSObject {} +(
static variables only get initialized once, regardless of if they're at global or local scope. In this case, you don't even need the nil - static storage class variables are zero-initialized by default. This declaration:
static
nil
static id theInstance;
is enough to be the same as what you have there.