File Cocoa / Cocoa.h not found

I use XMPPFrameworkin my application. I imported Cocoa / Cocoa.h into my .m file. But when I build a project, it Xcodeshows an error.

error: "Cocoa / Cocoa.h file not found."

How can I solve this error?

+5
source share
3 answers

If you are creating iOS, you should not #import <Cocoa/Cocoa.h>. This header exists only in OS X. For iOS, you need to directly include various frame headers (for example, #import <UIKit/UIKit.h>).

+8
source

Add this line:

 #import <Foundation/Foundation.h>

delete this:

 #import <Cocoa/Cocoa.h>
+2
source

#import "Cocoa/Cocoa.h" #import <Cocoa/Cocoa.h> .m

And Alos I don’t like Copy and Paste , so please refer to this Question / Answer Cocoa / Cocoa.h Not found (error)
This seems to be your question.

+1
source

All Articles