0

I have CoreGraphics, QuartzCore and AssetsLibrary frameworks imported. Why would I be getting an undeclared identifier error for CGImageDestinationRef?

Here is how I am declaring it:

 CGImageDestinationRef imageDestinationRef = CGImageDestinationCreateWithURL((__bridge CFURLRef)directoryURL, kUTTypeJPEG, 1, NULL);
PruitIgoe
  • 6,166
  • 16
  • 70
  • 137

1 Answers1

8

Because its defined in the ImageIO framework. Link and import it and you'll be fine.

Also the kUTTTypeJPEG constant is defined in the MobileCoreServices framework, so you will need that too.

Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235
  • You know, I breezed through the docs and saw IO and looked for that. Doh. : D – PruitIgoe Aug 20 '13 at 15:52
  • :) Common mistake, you would expect CG objects to belong to the `CoreGraphics` framework, but that's not always the case. Feel free to accept the answer if it helped you ;) – Gabriele Petronella Aug 20 '13 at 15:55
  • I had to wait to accept the answer, that solved that but now same issue with kUTTypeJPEG - am I missing another framework? – PruitIgoe Aug 20 '13 at 16:06