iPhone IOS5 Storyboard, how to load a UIViewController with a custom .xib file?

后端 未结 3 589
礼貌的吻别
礼貌的吻别 2021-02-02 14:15

I have some UIViewControllers from my old iOS4 project, they are using .xib, created in interface builder.

My new project, built for iOS5, uses storyboards.

3条回答
  •  不要未来只要你来
    2021-02-02 14:47

    You could copy the contents of the xib into the storyboard and then instantiate it using:

    - (id)instantiateViewControllerWithIdentifier:(NSString *)identifier
    

    after setting the identifier on it. If you need the instance of the storyboard you can get it this way:

    [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    

提交回复
热议问题