Open
Description
person.h
#import <Foundation/Foundation.h>
@interface Person : NSObject
+ (id)sharedInstance;
@end
person.m
+ (id)sharedInstance {
static Person *theSharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
theSharedInstance = [[self alloc] init];
});
return theSharedInstance;
}