This should do it:
Code:
UIAlertView *myal = [[UIAlertView alloc] initWithTitle:@"t" message:@"est" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[myal show];
[self performSelector:@selector(test:) withObject:myal afterDelay:2];
[myal release];
Code:
-(void)test:(UIAlertView*)x{
[x dismissWithClickedButtonIndex:-1 animated:YES];
}
Very quickly written, so it might not be the cleanest solution, but it most definitely works!