Laevand
Laevand

Reputation: 892

Code with CGColorSpaceCreateDeviceRGB does not compile

I'm trying to subclass UIButton and need to implement drawing gradient in drawRect: method. But calling any of CGColorSpaceCreateDeviceRGB(), CGColorGetComponents(), CGGradientCreateWithColorComponents() leads to a bunch of linker errors stating:

Apple Mach-O Linker (Id) Error

Undefined symbols for architecture i386: "_CGColorSpaceCreateDeviceRGB", referenced from: -[GradientButton drawRect:] in GradientButton.o

It seems like some header is missing, but searching through Quartz2D and CoreGraphics references still gave no result.

Upvotes: 1

Views: 1639

Answers (1)

Richard J. Ross III
Richard J. Ross III

Reputation: 55543

Did you link CoreGraphics.framework in your app?

It should look something like this:

Upvotes: 3

Related Questions