保持されることのない[Hoge alloc]。
// ARC
@implementation Hoge
-(instancetype)initWithA:(id)a B:(id)b{
Hoge *h = [[Hoge alloc] init];
h.a = a;
h.b = b;
return h;
}
// 使う時
Hoge *h = [[Hoge alloc] initWithA:@"A" B:@"B"];
まだコメントがありません。最初にコメントを残しませんか?