iOS: present view controller programmatically
问题 I'm using the presentViewController:animated:completion: method to go to another view controller. This is my code: AddTaskViewController *add = [[AddTaskViewController alloc] init]; [self presentViewController:add animated:YES completion:nil]; This code goes to the other UIViewController but the other controller is empty. I've always been using storyboards but now I need this to be done in code. 回答1: If you're using a storyboard, you probably shouldn't be using alloc and init to create a new