Cocoa/Cocoa.h file not found

2019-06-17 21:49发布

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?

3条回答
姐就是有狂的资本
2楼-- · 2019-06-17 22:25

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>).

查看更多
迷人小祖宗
3楼-- · 2019-06-17 22:25

Add this line :

 #import <Foundation/Foundation.h>

remove this :

 #import <Cocoa/Cocoa.h>
查看更多
我欲成王,谁敢阻挡
4楼-- · 2019-06-17 22:44

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.

查看更多
登录 后发表回答