All about life
網頁
(移至...)
首頁
Principle and Practice
Skill
Tool
About Me
▼
2013年1月28日 星期一
[iOS] autoreleasepool in iOS6 automated reference count
iOS 6之前, 像是 multi-thread的環境, 需要自己管理記憶體, 通常會看到如下的程式片段
NSAutoreleasePool *pool = [[NSAutoreleasedPool alloc] init];
.....
[pool drain];
iOS 6之後, 在 ARC的環境下, 只要頭尾以 @autoreleasepool{ ...} 包起來即可
Ref:
NSThreads in Automatic Reference Counting
NSAutoreleasePool Class Reference
沒有留言:
張貼留言
‹
›
首頁
查看網路版
沒有留言:
張貼留言