问题描述
如果我有一个故事板,其视图控制器已被标记.那么这两个API有什么区别?
If I have a storyboard whose viewcontroller has been tagged. then What's the difference between these 2 APIs?
我想知道的是返回的对象是否存在某些差异.它们是完全相同还是其中之一将初始化更多东西?
What I want to know is whether there is some difference on returned object. are they exactly same or one of them will initialize more things?
推荐答案
使用 instantiateInitialViewController:来初始化默认视图(初始),这是您通常不会以编程方式执行的操作
Use instantiateInitialViewController: to instatiate the default view (initial), this is something you wouldn't do programmatically usually
在需要 ViewController
并使用 storyboard
(storyboard ID(标识符))附加视图时,使用 instantiateViewControllerWithIdentifier :
Use instantiateViewControllerWithIdentifier: when you would like a ViewController
And attach a view from the storyboard
(storyboard Id (Identifier))
这篇关于InstantiateInitialViewController和InstantiateViewControllerWithIdentifier之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!