7

I am using XMPPFramework in my application. I have imported the Cocoa/Cocoa.h in my .m file. But when i build the project Xcode shows an error.

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

How can i solve this Error?

John
  • 163
  • 2
  • 3
  • 10

3 Answers3

12

If you're building for iOS then you shouldn't #import <Cocoa/Cocoa.h>. That header only exists on OS X. For iOS you need to include the various framework headers directly (e.g., #import <UIKit/UIKit.h>).

bdash
  • 18,110
  • 1
  • 59
  • 91
4

Add this line :

 #import <Foundation/Foundation.h>

remove this :

 #import <Cocoa/Cocoa.h>
Sandeep Sachan
  • 373
  • 3
  • 15
1

put #import "Cocoa/Cocoa.h" or #import <Cocoa/Cocoa.h> in your .m file

And Alos i don't like Copy and Paste , so please refer this Question/Answer
Cocoa/Cocoa.h Not Found (Error)
It is similar to your Question.

Community
  • 1
  • 1
  • 3
    The latter is the better choice -- angle brackets for system headers. – Caleb Apr 05 '13 at 05:54
  • 1
    #import is already in my .m file. but still this error occurring. By the way the link u provided dont give any help. thanks. – John Apr 05 '13 at 06:29