gpt4 book ai didi

ios5如何通过prepareForSegue : a UIImageView

转载 作者:行者123 更新时间:2023-11-28 17:38:50 25 4
gpt4 key购买 nike

我想将我的 UIImageView 从单击按钮传递到不同 ViewController 中的不同 UIImageView,其中加载了图像。

这是我的代码

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Make sure your segue name in storyboard is the same as this line
if ([[segue identifier] isEqualToString:@"MY_SEGUE"])
{
// Get reference to the destination view controller
ViewControllerName *vc = [segue destinationViewController];

// Pass the current UIImageView to a different UIImageView in a different view controller
[vc setUIImageView:UIImageView2];
}
}

到目前为止,当我运行它时,当我加载下一个 View 时没有任何反应。我没有错误。我需要在 - (void)viewDidLoad 中说些什么才能使它起作用吗?

有什么提示或建议吗???

谢谢

最佳答案

您需要对目标 View Controller 中的 ImageView 执行一些操作。您可能希望将 View 添加到您的 View 层次结构中。您可以在 viewDidLoadviewWillAppear: 中执行此操作。

关于ios5如何通过prepareForSegue : a UIImageView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8950378/

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