How do I add Objective C code to a FireBreath Project?

删除回忆录丶 提交于 2019-11-29 14:46:53

Your problem is that you have .h files that are being included by C++ files that have objective c type and/or includes in them. In order to do what you want all of your classes that are used by c++ need to either keep all obj c related stuff in an #ifdef or simply not expose anything obj c in the header file.

For example, you can use this ifdef in your header:

#ifdef __OBJC__
     // Objective C / C++ code here
#endif

It's important to remember that .h files are includes as well as header files, so they are actually included. If you include objective c code in a .cpp file the compiler gets confused and cries.


EDIT: The most important thing to remember is that you need to ensure that any objective c header files (or other files with objective c code) are not included from the cpp files. If you can do that you'll be fine.

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