背景描述
#import "TMUStoreMemoryDataCache.h"
static TMUStoreMemoryDataCache * _instance = nil;
@implementation TMUStoreMemoryDataCache
+ (instancetype)shareInstance{
//static TMUStoreMemoryDataCache * instance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_instance = [[TMUStoreMemoryDataCache alloc]init];
});
return _instance;
}
我在一下代碼中創(chuàng)建的單例厂抽,使用全局的static _instacce,就會出現以下錯誤丁眼,這個斷點即使不打開
All Exceptions`也會出現筷凤。后來我將上面全局的變量改成局部的,就不在出錯苞七。問題原因尚未找到
Execution was interrupted, reason: EXC_BREAKPOINT (code=1, subcode=0x101c2f740). The process has been returned to the state before expression evaluation.
解決
將全局_instace
換成局部的instace
藐守,就能解決
原因
還未找到具體原因