Avocado Posted November 20, 2008 Share Posted November 20, 2008 Hey everyone, I'm new to this site (first post), and new to Mac's (got my new MacBook 1 week ago today) and Mac development. I'm in Electrical Engineering so I've got some software experience, but mostly with C++. I think I'm picking up Objective C pretty well so far. I'm just having one problem: I'm trying to write a really basic iPhone app to get me started, and in the first class I've made, the line: #import <Cocoa/Cocoa.h> gives me an error saying "error: Cocoa/Cocoa.h: No such file or directory" Also, I did try searching on here, but it gives me an error every time. Thanks for your help. Link to comment https://www.insanelymac.com/forum/topic/137421-error-cocoacocoah-no-such-file-or-directory/ Share on other sites More sharing options...
bofors Posted November 20, 2008 Share Posted November 20, 2008 I have not done any iPhone programming yet, but I have about five years of Cocoa experience. I assume you have appropriately set-up an Xcode project for iPhone, if not that is your first problem. This might a be mistake for iPhone (I am not sure): #import <Cocoa/Cocoa.h> The Cocoa framework per se is for OS X, not iPhone. You might have to import the special framework for iPhone. If you use Xcode to automatically create the files for you new class, it should create the correct import for you. Link to comment https://www.insanelymac.com/forum/topic/137421-error-cocoacocoah-no-such-file-or-directory/#findComment-972653 Share on other sites More sharing options...
Avocado Posted November 21, 2008 Author Share Posted November 21, 2008 Ya I used XCode to create the files and I think I've set up the iPhone app project properly...hmm. I guess I'll download some sample code and investigate. Thanks for your help. Link to comment https://www.insanelymac.com/forum/topic/137421-error-cocoacocoah-no-such-file-or-directory/#findComment-972974 Share on other sites More sharing options...
Law_zg Posted November 21, 2008 Share Posted November 21, 2008 In iPhone there isn't any Cocoa.h header so you can't write #import <Cocoa/Cocoa.h> I think you should use #import <UIKit/UIKit.h> Link to comment https://www.insanelymac.com/forum/topic/137421-error-cocoacocoah-no-such-file-or-directory/#findComment-973310 Share on other sites More sharing options...
Avocado Posted November 22, 2008 Author Share Posted November 22, 2008 Thanks a lot, just removed it and all was fine...guess I should have figured that out on my own. Link to comment https://www.insanelymac.com/forum/topic/137421-error-cocoacocoah-no-such-file-or-directory/#findComment-974558 Share on other sites More sharing options...
Recommended Posts