我正在使用 ARC,在一种方法中我分配了一个操作对象。这会导致内存泄漏吗?如果是,我应该在哪里设置nil
?在完成块内部或之后[operation start];
?
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
// success downloading file
// Do something
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
// error downloading file
// Do something else
}];
[operation start];