SettingsViewController *viewController = [[SettingsViewController alloc] init];
[[self navigationController] pushViewController:viewController animated:YES];
so you could initialise using the name of the xib or storyboard as everyone is suggesting and that’s valid.
Although if you’re using storyboards and your initial viewcontroller is on the storyboard, they maybe rather do the following,
// Method in your initial viewcontroller
- (void)youPushMethod {
// Name your segue on your storyboard, e.g. SegueIndentifier
[self performSegueWithIdentifier:@"SegueIndentifier" sender:self];
}
Then,
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@“SegueIndentifier"]) {
SettingsViewController *settingsViewController= segue.destinationViewController;
}
}