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:
you would write:
@autoreleasepool blocks are more efficient than using an instance of
NSAutoreleasePool directly; you can also use them even if you do not use ARC.
@autoreleasepool blocks instead. For example, in place of:
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init; |
// Code benefitting from a local autorelease pool. |
[pool release]; |
@autoreleasepool { |
// Code benefitting from a local autorelease pool. |
} |
NSAutoreleasePool directly; you can also use them even if you do not use ARC.
相关文章推荐
- 关于NSAutoreleasePool' is unavailable: not available in automatic reference counting mode
- 关于NSAutoreleasePool' is unavailable: not available in automatic reference counting mode
- 关于NSAutoreleasePool' is unavailable: not available in automatic reference counting mode的解决方法
- 关于NSAutoreleasePool' is unavailable: not available in automatic reference counting mode
- Everything you need to know about automatic reference counting (ARC)
- 关于NSAutoreleasePool' is unavailable: not available in automatic reference counting mode的解决方法 .
- ARC(Automatic Reference Counting )技术概述
- Automatic Reference Counting (ARC) 自动引用计数
- 'release' is unavailable: not available in automatic reference counting mode解决方案
- Automatic Reference Counting(ARC)特性学习(iOS5新特性学习之五)
- JSONKit does not support Objective-C Automatic Reference Counting(ARC) / ARC forbids Objective-C objects in struct
- Objective-C - ARC(Automatic Reference Counting)自动引用技术详解
- ARC(Automatic Reference Counting )技术概述
- ARC(Automatic Reference Counting )技术概述
- ARC(Automatic Reference Counting )技术概述
- ARC(Automatic Reference Counting )技术概述
- 'release' is unavailable: not available in automatic reference counting mode
- 'release' is unavailable: not available in automatic reference counting mode
- ARC(Automatic Reference Counting )技术概述
- Swift 自动引用计数(Automatic Reference Counting, ARC)