c++ - Include mm file in m file -
I have a C ++ code and a class announcement. MM file is I want to include it in another .m file but the compiler starts giving an error in another class unknown type name 'class';
For example
AM - & gt; In this class "B.H." Has been included
B.h - & gt; Include "AH" when trying to import #h. Returns the error.
BM - & gt; # Ah gives an error to "ah" while trying to import.
I have tried to use the structure in .m file but this method is not called in the example.
Any help would be appreciated.
What are you actually trying to do? Trying to include source files from within source files is very rare, and usually there is a smell of something else in the architecture of your program.
Usually, you must have a title and implementation file .m and .mm file each. If you do not want to place ObjC class announcements in the main header (for example, because you are implementing a framework and it is the public API of the header framework), you can have multiple headers like you have a MyClass.h and One can be MyClassPrivate.h, and only the second will be included.
You can not actually use C ++ from plain objc (which is for objc ++), so the title of .mm in the ObjC file is not possible. Unless you do not divide it into ObjC parts (which you can use } and C ++ parts, eg in many headers. ObjC and ObjC + For more information about the mix, see your answer in this thread: I have also done a podcast episode where I go in more detail to use C ++ and OBJC Irregularities: In particular, make sure you are a 100% firm that is a compilation unit Or you will always have issues with the OJJC header from the CA ++ or (oz) C + header with the objc header.
Comments
Post a Comment