摘要:
要用到objc的单例模式,自己写了一个,发现出现内存泄漏,网上找了国外博文的方法,简单实用,于是记录下来头文件@interface ModelLocator : NSObject{ }+(id)sharedModelLocator;mm文件@implementation ModelLocatorstatic ModelLocator * _sharedModel = nil;+ (void)initialize{ if (self == [ModelLocator class]) { _sharedModel = [ [self alloc] init]; ... 阅读全文