tags:

views:

87

answers:

2

In my application there are two view.First view na dsecond view. In my second view there is one time for 60 sec.When i go first view to second view then timr is start.when i back to first view thne timer is running in background.when timer is over then one popup is generated.When i click on pop up(ok button) then i want to go in second view.Acctully pop is in second view.

How to solve this problem

A: 

Do you use an UIAlertView as your popup?

If yes, your view controller has to be conform to the UIAlertViewDelegate protocol and you can implement the alertView:clickedButtonAtIndex: method in order to react to the button you clicked in the popup. Then you can push your view to the other.

schaechtele
A: 

in your View1... before you change your view from view1 to view2 put this line

[self performSelector:@selector(Method1) withObject:nil afterDelay:60]; 

it will call this method after 60 second in view2 keep one boolean variable... BoolAlert and set it in Method1 function write something like

-(void) Method1
{
View2viewController *view2 = [[ View2viewController alloc] initWithNibName:@"View2viewController" bundle:nil];
view2.BoolAlert = TRUE;
[self.navigationController pushViewController:view2 animated:YES];
        [view2 release];


}

in view2's viewDidLoad method write

- (void)viewDidLoad {
    [super viewDidLoad];
if(BoolAlert)
{
//show alert here 
}
}
mihirpmehta