gpt4 book ai didi

iphone - iOS6:如何通过标识符连接 Storyboard 中的 UIViewController?

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:31:49 25 4
gpt4 key购买 nike

有没有人知道如何将 Storyboard 中的 UIViewControllers 与标识符连接起来?它似乎不再起作用了..

最佳答案

选择 UIViewController,一旦您看到突出显示的 UIView(通常是蓝色),然后转到 XCODE 上最左边的列。选择属性检查器,您将在“ View Controller ”部分看到“标题”和“标识符”标签。给它起任何名字,在程序中引用你的 View Controller ,你可以这样做:

UIStoryboard *us = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil];
FirstViewController *fvc = [storyboard instantiateViewControllerWithIdentifier:@"firstview"];

这有效,如果您有任何问题,请告诉我。

关于iphone - iOS6:如何通过标识符连接 Storyboard 中的 UIViewController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12504164/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com