ios - CGImageCreateWithMaskingColors没有匹配的函数

标签 ios objective-c xcode5

我正在项目中https://github.com/kuapay/iOS-QR-Code-Generator上使用QR码创建项目。我已完全按照说明进行添加。

我可以毫无问题地在测试设备上编译和运行项目,但是当我尝试对其进行存档时,出现以下错误:

路径/到/项目/条形码.mm:67:33:没有匹配功能可调用'CGImageCreateWithMaskingColors'

我正在把头发拉出来。这是它的代码片段以及正在使用的变量声明。

CGImageRef rawImageRef = image.CGImage;

const float colorMasking[6] = {222, 255, 222, 255, 222, 255};

UIGraphicsBeginImageContext(image.size);
CGImageRef maskedImageRef = CGImageCreateWithMaskingColors(rawImageRef, colorMasking);

最佳答案

我知道提问者找到了答案,但是我的问题是发布构建应该没有。因为我们也需要非 Activity 架构!

问题在于XCode在新的XCode 5.1(5B130a)中对64位版本的类型更为严格。 CGImageCreateWithMaskingColors的第二个参数是CGFloat,因此将类型从float更改为CGFloat即可解决。

//const float colorMasking[6] = {222, 255, 222, 255, 222, 255};//before
const CGFloat colorMasking[6] = {222, 255, 222, 255, 222, 255};//after

UIGraphicsBeginImageContext(image.size);
CGImageRef maskedImageRef = CGImageCreateWithMaskingColors(rawImageRef, colorMasking);

关于ios - CGImageCreateWithMaskingColors没有匹配的函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19259333/

相关文章:

iphone - 如何更新字典中的所有项目? iPhone

ios - NSJSONSerialization在iOS6上有效,但在iOS5.1上无效

objective-c - -1 < 4 返回 NO?太奇怪了

ios - 如何调整 iCarouselTypeLinear View 移动到顶部的框架

iphone - iOS 7 中导航 Controller 及其 Root View Controller 的奇怪行为

ios - 资源文件未在本地化中显示

c++ - 苹果 LLVM 5.0 pragma 优化

ios - 页面 View ScrollView 不是锻炼

ios - 在 OpenGL ES 中隐藏部分图像

ios - 是否有可能将您在消息应用程序中收到的相同消息发送到您的应用程序中?