storyboardやxibでインスタンスを作る

storyboardやxibでインスタンスを作る時にどうだっか、調べる事があったので、メモ

storyboard

UIViewController *controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"hoge"];
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    MyViewController *controller = [segue destinationViewController];
    controller.nanika = @"hogehoge";
}

xib

[[UIViewController alloc]initWithNibName:@"hoge" bundle:nil];

以上、春野菜を最近食べる事が増えた堀でした。