您的位置:首页 > Web前端

If you use Automatic Reference Counting (ARC), you cannot use autorelease pools directly

2012-06-25 10:45 459 查看
Important If you use Automatic Reference Counting (ARC), you cannot use autorelease pools directly. Instead, you use
@autoreleasepool blocks instead. For example, in place of:

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init;

// Code benefitting from a local autorelease pool.

[pool release];

you would write:

@autoreleasepool {

// Code benefitting from a local autorelease pool.

}

@autoreleasepool blocks are more efficient than using an instance of
NSAutoreleasePool directly; you can also use them even if you do not use ARC.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐