參考http://www.reibang.com/p/6b012ebc10fe
.h文件
```objective-c
#import?
@interfaceCYWinLoseSound :NSObject
+ (instancetype) shareTsetSington;
@end
```objective-c
```objective-c
.m文件
#import "FTTsetSington.h"
@implementation FTTsetSington
static FTTsetSington*_instance =nil;
+ (instancetype) shareTsetSington{
//?staticdispatch_once_tonceToken;不用手打宾袜,你直接打dispatch_once會(huì)直接生成staticdispatch_once_tonceToken這句
? ? staticdispatch_once_tonceToken;
//dispatch_once這個(gè)函數(shù)可以使其參數(shù)內(nèi)的block塊只在全局執(zhí)行一次從而達(dá)到目的
? ? dispatch_once(&onceToken, ^{
? ? ? ? _instance = [[self alloc] init];
? ? });
? ? return _instance;
}
@end
```objective-c