gpt4 book ai didi

ios - 图像未显示在另一个屏幕上

转载 作者:行者123 更新时间:2023-11-29 12:32:01 26 4
gpt4 key购买 nike

在我选择照片库中的图像后,它不会显示在另一个屏幕的 View 中。有任何想法吗??这是prepareforsegue。不知道是不是这部分有问题还是可能。

   - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"InfoSegue"]) {
UITabBarController* tabBar = segue.destinationViewController;

InstructionsViewController* instructions = [tabBar.viewControllers[0]
viewControllers][0];
instructions.delegate = self;

SettingsViewController* settings = [tabBar.viewControllers[1] viewControllers][0];
settings.delegate = self;

MoreViewController* more = [tabBar.viewControllers[2] viewControllers][0];
more.delegate = self;
UINavigationController* navSubscription = [[UIStoryboard storyboardWithName:STORYBOARD_FILE_NAME bundle:nil] instantiateViewControllerWithIdentifier:@"SubscriptionStoryboardID"];
SubscriptionViewController* subscription = navSubscription.viewControllers[0];
subscription.delegate = self;

NSMutableArray* viewControllers = [tabBar.viewControllers mutableCopy];
[viewControllers insertObject:navSubscription atIndex:viewControllers.count - 1];
tabBar.viewControllers = viewControllers;

} else if ([segue.identifier isEqualToString:@"EditorScreenSegue"]) {
[DesignController startDesign:_selectedDesign];

EditorViewController* editor = segue.destinationViewController;
editor.delegate = self;
}
else if ([segue.identifier isEqualToString:@"MyDesignsSegue"]) {
MyDesignsViewController* designs = segue.destinationViewController;
designs.delegate = self;
}
}

最佳答案

 else if ([segue.identifier isEqualToString:@"EditorScreenSegue"]) {
[DesignController startDesign:_selectedDesign];

EditorViewController* editor = segue.destinationViewController;
editor.delegate = self;

// Use this code
editor.selectedImage = currentImage;
// selectedImage = its a UIImage property in EditorViewController.h
// currentImage = its a UIImage reference for current view controller selected image object
}

在 else if block 中找到添加的行。您没有传递 UIImage 对象,那么它将如何显示。如代码所示,在下一个 View 中,您应该在代码中使用 selectedImage 引用。

希望这会给你一个提示,你错​​过了什么。

关于ios - 图像未显示在另一个屏幕上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27409848/

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