如何延迟弹出页面?

how to delay a popup page?

我刚刚构建了一个 Activity 指标视图,并在 Xcode 中构建了一个弹出页面。如何在 Activity 指标视图中获得 3 秒的延迟,然后切换到弹出页面?

这是我的 Viewcontroller.m

- (IBAction)Connect:(UIButton *)sender forEvent:(UIEvent *)event 
{
  [self performSelector:@selector(delay2) withObject:Nil afterDelay:6.0];
  [self performSelector:@selector(delay1) withObject:ConnectAct afterDelay:0.0];
  UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"LP01;" message:@"No Connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Help", nil];
  [alert show];
}

- (IBAction)ConnectLP02:(UIButton *)sender 
{
  [self performSelector:@selector(delay2) withObject:Nil afterDelay:6.0];
  [self performSelector:@selector(delay1) withObject:ConnectAct afterDelay:0.0];
  UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"LP02;" message:@"No Connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Help", nil];
  [alert show];
}

- (void)delay1 {
  ConnectAct.alpha = 1.0;    
}

- (void)delay2 {

}
- (IBAction)ConnectLP02:(UIButton *)sender 
{
  [self performSelector:@selector(delay2) withObject:Nil afterDelay:6.0];
  [self performSelector:@selector(delay1) withObject:ConnectAct afterDelay:0.0];

}

- (void)delay1 {
  ConnectAct.alpha = 1.0;    
}

- (void)delay2 {
  UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"LP02;" message:@"No Connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Help", nil];
  [alert show];
}