【发布时间】:2011-12-09 04:59:40
【问题描述】:
在 ARC 之前,我有以下代码在异步操作进行时保留委托:
- (void)startAsyncWork
{
[_delegate retain];
// calls executeAsyncWork asynchronously
}
- (void)executeAsyncWork
{
// when finished, calls stopAsyncWork
}
- (void)stopAsyncWork
{
[_delegate release];
}
ARC 与此模式的等价物是什么?
【问题讨论】:
标签: objective-c ios memory-management ios5 automatic-ref-counting