I have iPhone and I want that when AlertView is shown and user presses OK button after that view should be changed but it is not happening.
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Thank you" message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
return;
[self moveToView];
-(void)moveToView
{
MainViewController*targetController=[[MainViewController alloc]init];
[self.navigationController pushViewController:targetController animated:YES];
}
Please use
UIAlertViewDelegateNote: Implement the
UIAlertViewDelegatein your interface Declaration. Also while declaring UIAlertView set the delegate to self.Hope this helps you.