The thing is, to invoke clearDelegatesAndCancel, you must have an ASIFromDataRequest object handle that runs asynchronously. This means that you must configure it as a property, for example ...
@interface MyViewController : UIViewController <ASIHTTPRequestDelegate>
{
ASIFormDataRequest *theRequest
...
}
@property (nonatomic, retain) ASIFormDataRequest *theRequest;
Then in your .m do not declare a new request object, just assign your formdatarequest to the iVar class:
@synthesize theRequest;
-(void)viewDidLoad
{
self.theRequest = [ASIFormDataRequest requestWithUrl:myUrl];
}
-(void)viewWillDisappear:(BOOL)animated
{
[self.theRequest clearDelegatesAndCancel];
}
-(void)dealloc
{
[theRequest release];
}
, , , .
, . viewcontroller (, UINavController) , , .