我有一个sharedInstance
, 创建于
+ (TheConstantsPlaceholder *)sharedInstance
{
static TheConstantsPlaceholder *sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[TheConstantsPlaceholder alloc] init];
// Do any other initialisation stuff here
});
return sharedInstance;
}
[TheConstantsPlaceholder sharedInstance]
如果不保留对象会怎样?
使用后会立即释放吗?如果我想在我的程序中使用它,我必须将它存储在strong
iVar 中吗?