我正在使用presentViewController(现在)从一个UIViewController到另一个UIViewController,但是当我触摸按钮以到达下一个UIViewController时,第一次呈现时会出现第二次“滞后”。
任何人都知道一种简单的方法可以像“加载屏幕”一样运行X段时间,然后会出现所需的ViewController?这种方式实际上并不会发生延迟,因为它会被“加载屏幕”所掩盖
先谢谢!!
答案 0 :(得分:0)
在第一堂课中写下这段代码,例如: -
- (IBAction) clickButton:(UIButton *) sender
{
[self performSelector:@selector(presentAnotherView) withObject:nil afterDelay:1.0f];
}
- (void) presentAnotherView
{
HomeViewController *home = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil];
[self presentModalViewController:home animated:YES];
}