【发布时间】:2011-11-23 10:37:25
【问题描述】:
我正在尝试将UIImage 从UITabBarController1 中的一个UIView 传递给UITabBarController2 中UINavigationController 中的另一个UIView。在 View1 我试过这个:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
{
UploadModifyViewController *view2 = [self.storyboard instantiateViewControllerWithIdentifier:@"modify"];
UITabBarController *navBar = [self.storyboard instantiateViewControllerWithIdentifier:@"navBar"];
view2.imageView.image = image; //<-----
[self dismissModalViewControllerAnimated:NO];
[self presentModalViewController:navBar animated:YES];
}
记住,view2 在 NavigationController 中,而 NavigationController 在 TabBarController 中。外部变量不起作用,因为这些不能与 UI 元素一起使用。
也发布了这个问题here,但仍然没有解决方案。 在这个论坛中,我发布了一个屏幕截图,以便更好地了解我尝试将图像从何处传递到何处。
【问题讨论】:
-
你还没说什么没用。
标签: ios cocoa-touch uiview uikit uitabbarcontroller