iOS UIKit/UIKit not found

xcodeNewbie

macrumors member
Original poster
Jul 1, 2011
65
0
I've been developing apps for the iPhone for a little while. Just recently I got an idea for a mac app. I started Xcode, chose cocoa application written in objective c, and it gave me a starting template like usual. However right away there was build errors, "UIKit/UIKit.h" not found. Xcode has no problem finding UIKit when I write apps for the iPhone. Also, none of my classes even use UIKit, so why does it matter if it can't find it?
 

chown33

Moderator
Staff member
Aug 9, 2009
8,658
4,904
vertical
UIKit doesn't exist on Mac OS X. The approximate equivalent is AppKit. Google it.

You get the error because you told the compiler to import something. It doesn't matter whether you use anything from the import or not. It's an error if the compiler can't import what you tell it to.
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
UIKit is specific for iPhone, so it's normal it doesn't find it on the Mac OSX.
You need to add <cocoa/cocoa.h> I think. Doesn't it import automaticly at a Mac OSX project? that would suprise me.
 

dejo

Moderator
Staff member
Sep 2, 2004
15,981
450
The Centennial State
I started Xcode, chose cocoa application written in objective c, and it gave me a starting template like usual. However right away there was build errors, "UIKit/UIKit.h" not found.
You sure that's all you did? Either you've missed some steps or your Xcode app templates are messed up. Because if you just create a Cocoa Application and Build it right away, you shouldn't get any errors and none of the code should try to import UIKit.
 

Similar threads

Register on MacRumors! This sidebar will go away, and you'll see fewer ads.