Cocoa/Cocoa.h file not found

假如想象 提交于 2019-12-23 08:10:07

问题


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?


回答1:


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




回答2:


Add this line :

 #import <Foundation/Foundation.h>

remove this :

 #import <Cocoa/Cocoa.h>



回答3:


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.



来源:https://stackoverflow.com/questions/15826825/cocoa-cocoa-h-file-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!