I use custom delegate objects to perform some cleanup tasks after the request completes. ASIHTTPRequest does not save delegates, so I cannot auto-update them. Right now I am posting and releasing delegates.
Application Member
MyDelegate *delegate = [[MyDelegate alloc] init];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:delegate];
Mydelegate.m
- (void)requestFinished:(ASIHTTPRequest *)request
{
[self release];
}
- (void)requestFailed:(ASIHTTPRequest *)request
{
[self release];
}
Is there a better way to do this? Outstanding delegates seem ugly, and the build and analysis of Xcode feels uncomfortable with what I'm doing.
David source
share