In the login method set the UserInfo for the timer. like below
ASIHTTPRequest *theRequest = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]];
myTimer = [NSTimer scheduledTimerWithTimeInterval:60.0f
target:self
selector:@selector(timerFired:)
userInfo:theRequest
repeats:NO];
why are you invalidating the timer if repeats:NO. If you set repeats to NO timer will be invalidated automatically.
- (void)timerFired:(NSTimer *)timer
{
///[myTimer invalidate]; /// coment this. it will work.
ASIHTTPRequest *request = (ASIHTTPRequest *)[timer userInfo];
UIAlertView *warning = [[[UIAlertView alloc] initWithTitle:@"Error" message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]autorelease];
[warning show];
[request cancel];
///[request release]; ///request is an autorelease object
}
If you do this it should work properly.
Also in the see the argument in the method timerFired: timer is the argument that is passed, whenever the timerFired: method is invoked by the timer.