我正在尝试为iOS10重建Titanium模块(https://github.com/Exygy/Titanium-Ti.Barcode)
重建时,出现以下错误,并且构建失败。
cannot initialize a variable of type 'UIImage *' with an rvalue of type
'CIImage *'
UIImage *image = [blob image];
^ ~~~~~~~~~~~~
以下是代码的生成位置:
id blob = [args valueForKey:@"image"];
ENSURE_TYPE(blob, TiBlob);
UIImage* image = [blob image];
我是物镜C的菜鸟。
最佳答案
您可以使用以下命令:
objective-c :
CIImage *ciImage = [blob image];
UIImage *uiImage = [[UIImage alloc] initWithCIImage:ciImage];
Swift 4.0:
let ciImage: CIImage? = blob.image()
let uiImage = UIImage(ciImage: ciImage!)
关于ios - 在iOS 10上从CIImage创建UIImage,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40887936/