As a beginner of iOS developer. I use ARC in my project. And I even use ASIHttpRequest to make some work easier. As you know, ASIHttpRequest not support ARC. I’ve added the -fno-objc-arc compiler flag to make it work.
Now, here is my question. How can I release the ‘request’ object if some of my code like this :
NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"];
__block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setCompletionBlock:^{
NSData *responseData = [request responseData];
}];
[request setFailedBlock:^{
NSError *error = [request error];
}];
[request startAsynchronous];
There is no need to release this ‘request’ since these code is in the file using ARC. The compiler will help you to insert release method. However for objects in ASIHTTPRequest.m file, you need to release them (actually you do not need to do that) since you have added the -fno-objc-arc compiler flag, and complier will not insert release method for you.