iphone - 将 UIImage 从一个类传递到另一个类

标签 iphone ios uiimage avfoundation

我正在使用 this tutorial用于使用 AVFoundation 捕获图像。我正在尝试将捕获的图像从 CaptureSessionManager(一个 NSObject 类)返回到 AROverlayViewController。我该怎么做呢?

我尝试将 @property (nonatomic, retain) UIImage *finalImage; 放在 AROverlayViewController.h 中,然后在 CaptureSessionManager.m 中设置 arController.finalImage = image;,但是日志显示 finalImage 为 null

关于如何最好地做到这一点有什么想法吗?谢谢!

最佳答案

CaptureManager 上有一个属性

@property (nonatomic, retain) UIImage *stillImage;

通过这段代码可以得到

UIImage *final = [captureManager stillImage];

关于iphone - 将 UIImage 从一个类传递到另一个类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12085526/

相关文章:

iPhone 内存消耗

iphone - hidesBottomBarWhenPushed = NO 不起作用?

iPhone UIViewController 滞后

android - "Show Inspector"未在 ios 模拟器中显示,"The Map Size Property Not Writable"在 android react-native 中出现问题

swift - 将 CALayer 作为子层添加到 UIImage 时出现意外行为

iphone - 除了使用 NSTimer 显示 AVAudioPlayer 音频文件的剩余时间之外,还有其他方法吗?

iphone - 我可以通过屏幕截图检测导入的 ALAsset 照片是否是拍摄的吗?

ios - 无法通过 Objective-C 在 iOS13.x 上获取 AVPlayerLayer

ios - 如何为图像swift ios制作图像页面查看器

ios - 以编程方式创建更高分辨率的 PNG 图像