在ARC之前,我有以下代码在异步操作正在进行时保留委托:
- (void)startAsyncWork
{
[_delegate retain];
// calls executeAsyncWork asynchronously
}
- (void)executeAsyncWork
{
// when finished, calls stopAsyncWork
}
- (void)stopAsyncWork
{
[_delegate release];
}
Run Code Online (Sandbox Code Playgroud)
ARC的这种模式相当于什么?
memory-management objective-c ios ios5 automatic-ref-counting