1

我正在尝试继承 UIButton 并且需要在 drawRect: 方法中实现绘制渐变。但是调用任何 CGColorSpaceCreateDeviceRGB()、CGColorGetComponents()、CGGradientCreateWithColorComponents() 都会导致一堆链接器错误,说明:

Apple Mach-O 链接器 (Id) 错误

架构 i386 的未定义符号:“_CGColorSpaceCreateDeviceRGB”,引用自:-[GradientButton drawRect:] in GradientButton.o

似乎缺少一些标题,但通过 Quartz2D 和 CoreGraphics 参考搜索仍然没有结果。

4

1 回答 1

3

CoreGraphics.framework在你的应用程序中链接了吗?

它应该看起来像这样:

于 2012-05-04T12:08:42.090 回答