[OC]单例的写法
作者:
汴城码农 | 来源:发表于
2022-06-24 17:13 被阅读0次@interface NTESLanguageManager : NSObject
@property (nonatomic,strong) NSDictionary *langDict;
+ (NTESLanguageManager *)shareInstance;
@end
@implementation NTESLanguageManager
static NTESLanguageManager *shareInstance = nil;
+ (NTESLanguageManager *)shareInstance{
@synchronized(self) {
if (shareInstance == nil) {
shareInstance = [[NTESLanguageManager alloc] init];
}
return shareInstance;
}
}
@end
本文标题:[OC]单例的写法
本文链接:https://www.haomeiwen.com/subject/cmqbvrtx.html
网友评论