All about life
網頁
首頁
Principle and Practice
Skill
Tool
About Me
顯示具有
ARC
標籤的文章。
顯示所有文章
顯示具有
ARC
標籤的文章。
顯示所有文章
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
較舊的文章
首頁
訂閱:
文章 (Atom)