简体   繁体   中英

Using pushViewController is very slow on iPad

I'm trying to move from one UIViewController to another using -pushViewController:animated using the below snipped :

 SomeController *tabBar = [self.storyboard instantiateViewControllerWithIdentifier:@"mycus"];

[self.navigationController pushViewController:tabBar animated:YES];

Moving from one UIViewController (which has no UIViews or images) has a 3 second delay before moving. What is causing this issue and how would I solve it?

For storyboard, click on the segue you have created, give it an identifier like "someSegue".

Next you will want to trigger the prepareForSegue delegate in your viewcontroller doing the following...

 [self performSegueWithIdentifier:@"SomeSegue" sender:nil];

..Then you will want to include the delegate method in your view controller and do any preparing you might want before the next view controller is initialised.

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

SomeController *vc = [segue destinationViewController];

// Here you will want to do your prep e.g. pass iVars etc from one controller to the other.

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM