gpt4 book ai didi

ios - 更新到XCode 5.1后出现错误

转载 作者:行者123 更新时间:2023-12-01 19:01:29 25 4
gpt4 key购买 nike

PCSEQAudioBar

嗨,我正在开发一个使用PCSEQAudioBar的应用程序,它在 Xcode 5.0.2 上运行良好,并将其更新为 5.1 后,突然开始出现此错误。.再也无法编译或部署我的代码它或任何东西

Incompatible pointer types passing retainable parameter of type 'CFArrayRef' (aka 'const struct __CFArray *')to a CF function expecting 'const CGFloat *' (aka 'const float *') type

我在这条线上收到此错误…
CGGradientRef _gradientRef = CGGradientCreateWithColorComponents(rgb, (__bridge CFArrayRef) colors, NULL, sizeof(colors) / (sizeof(colors[0]) * 4));

请帮助…预先感谢..

最佳答案

您需要传递CGFloat数组,而不是NSArray

例如:

static const CGFloat colors [] = { 
0.894, 0.894, 0.894, 1.0,
0.694, 0.694, 0.694, 1.0
};

有关该API的更多信息,请访问 Apple docs

The number of items in this array should be the product of count and the number of components in the color space. For example, if the color space is an RGBA color space and you want to use two colors in the gradient (one for a starting location and another for an ending location), then you need to provide 8 values in components—red, green, blue, and alpha values for the first color, followed by red, green, blue, and alpha values for the second color.

关于ios - 更新到XCode 5.1后出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22608555/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com