【发布时间】:2013-02-01 09:28:52
【问题描述】:
在 iPhone 中使用 popview 控制器时,任何人都有将图像从一个视图传递到另一个视图的精确解决方案。
请给我一些关于这个问题的指导。 谢谢。
【问题讨论】:
-
您可以创建协议并传递图像。另一种方法是将图像存储在 appdelegate 或任何全局图像对象中。
-
您可以使用 ivar 将变量从一个类传递到另一个类。
-
发布您的代码,因为现在我们必须猜测您在做什么。通过您的代码,我们会指出您的问题所在。
-
你试过什么? .如果您发布一些代码,那么我们可以帮助您。 no1 将为您提供您想要的完整代码。
-
这里我想传递裁剪后的图像。在第一个视图中 -(void)btn_Press {croppedViewcontroller* myCropImg = [[croppedViewcontrolleralloc]initWithNibName:@"croppedViewcontroller" bundle:nil]; [myCropImg setScrollView:self.img.image]; [self.navigationController pushViewController:myCropImg 动画:YES]; } ////这里我在做cropping.CGImageRef imageRef=CGImageCreateWithImageInRect([imageview.image CGImage],cropRects); resultImage = [UIImage imageWithCGImage:imageRef]; CGImageRelease(imageRef); targetview.imageview.image = self.image; [self.navigationController popViewControllerAnimated:YES];
标签: iphone ios objective-c popviewcontroller