#import <Foundation/Foundation.h>
@interface Singleton : NSObject
@property (nonatomic, strong) NSString *singletonData;
+ (Singleton *)sharedManager;
@end
#import "Singleton.h"
@implementation Singleton
@synthesize singletonData = _singletonData;
static Singleton *sharedManager = nil;
+ (Singleton *)sharedManager
{
static dispatch_once_t once;
dispatch_once(&once, ^{
sharedManager = [[self alloc] init];
});
return sharedManager;
}
@end