我有两个视图,一个是 Gameview,另一个是一个菜单,我希望用户在其中选择一个按钮,它将 GameView 中的图像视图更改为该图像。
我有一些代码可以做到这一点,但它似乎没有工作......
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqual:@"goToGameViewsSegue"]) {
MainMenuView_4inch_White *dest = [segue destinationViewController];
dest.imageView = CloudyBlue; //set the image in your view as the image in the settings view
[dest.imageView setImage:[UIImage imageNamed:@"Cloudy-Eye-Blue.png"]];
NSLog(@"Image should have been changed here.. How come it didn't?");
}
}
我确实检查了所有的连接,如果 segues 连接了,一切都很好,所以不能这样。