重複の可能性:
allocとallocWithZoneの違いは何ですか?
allocWithZoneオブジェクト自体に近いメモリ位置を使用することでパフォーマンスを向上させるのに役立つという記事を読みました。これは本当ですか?allocWithZoneの代わりに使用することをお勧めしますallocか?allocとallocWithZoneの違いは何ですか?
証明された例は次のとおりです。
- (id)init
{
if (self = [super init])
{
_myString = [[NSString allocWithZone:[self zone] init]];
}
return self;
}