gpt4 book ai didi

ios - 从 UIPopoverController 的 UITableviewCell 中连接新的 Storyboard。

转载 作者:行者123 更新时间:2023-11-30 13:53:56 25 4
gpt4 key购买 nike

我有一个按钮,选择该按钮后我会显示一个popovercontroller,它是UITableviewController的子类。当我选择表格 View 中的任何单元格时,我想推送新的 Storyboard。

我尝试通过 Storyboard 进行排序,但它不起作用。

如何实现这一目标?

最佳答案

也许是这样的

func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) {    

var mainView: UIStoryboard!

mainView = UIStoryboard(name: "storyBoardIdentifierDefinedinstoryboard", bundle: nil)

let viewcontroller : UIViewController = mainView.instantiateViewControllerWithIdentifier("controllerIdentifier") as UIViewController

[self presentViewController: viewcontroller animated:YES completion:nil];
}

您必须在 Storyboard 中定义标识符,否则将会出现异常。

关于ios - 从 UIPopoverController 的 UITableviewCell 中连接新的 Storyboard。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33891572/

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