Hub*_*yer 11
为每个ViewController提供故事板中的唯一标识符.然后在appDelegate中:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"PUT_UNIQUE_ID_HERE"];
//DO WHAT YOU WANT WITH YOUR VIEWCONTROLLER
//Example:Set it as the root view of the app window...
Run Code Online (Sandbox Code Playgroud)
为每个ViewControllers分配一个单独的ID,然后使用以下命令实例化所需的ID:
UIViewController *initialVC = [storyboard instantiateViewControllerWithIdentifier:@"<identifier>"];
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6148 次 |
最近记录: |