Unknown type name ‘UIImage’

I also had the same problem and fixed it using

#import <UIKit/UIKit.h>

However, I dug around some more and compared a project made in XCode 6 compared to Xcode 5, and I noticed that Xcode 6 did not create a prefix header file. The prefix header file is implicitly imported into every class, and the prefix header file (.pch) includes UIKit as well as Foundation.

To create a pch file, go to File -> New -> File -> Other -> PCH file. Edit the name to “YourProject-prefix.pch”. Add the following:

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif

Then you need to set the build settings. Go to your project -> build settings -> search at the top: prefix header.

You will see Precompile Prefix Header -> change to yes.
Also, right below is Prefix Header. Add the path of your prefix header. Should be like: “YourProject/YourProject-prefix.pch”.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)