2

I copy and pasted the following line of code into a .m file:

uiipc.mediaTypes = @[(NSString *)kuTTypeImage];

But even though I had linked MobileCoreServices.framework and did #import <MobileCoreServices/MobileCoreServices.h> I can't get rid of this error:

Use of undeclared identifier 'kuTTypeImage'

Background

I copied this piece of code from http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/lectures/Lecture%2017_0.pdf to add picture taking capabilities to my iPhone app.

From Symbol not found: kUTTypeImage I figured out I had to link MobileCoreServices.framework. I indepedently figured out I had to #import <MobileCoreServices/MobileCoreServices.h>. I think I've done everything by the book, but why am I still getting this error?

Community
  • 1
  • 1
Michael Osofsky
  • 11,429
  • 16
  • 68
  • 113

1 Answers1

1

I think the problem stems from having copied and pasted the line of code before linking the framework and importing the correct header file.

I managed to fix the problem by re-writing the line of code. When I began typing kuTTypeImage Xcode's code completion found the variable. So I let code completion finish the variable name and the error suddenly dissapeared.

Michael Osofsky
  • 11,429
  • 16
  • 68
  • 113