How much integration do C++ and Objective C have in Objective C++? I realize that Objective C++ compiles both C++ and Objective C code, but do the languages actually interact with each other?
For example can I create a template of a Objective C object? How about inheriting an Objective C class from a C++ class?
What I am basically trying to ask is do the languages mix or do they simply compile together in the same file? To what extent?
Well it’s quite common to use Objective-C++ to build applications. You can wrap Objective-C around C++ code but you can’t share objects. For example you can’t create an NSString object in Objective-C and trying to call the method hasSuffix: from C++ and visa versa. So to share content between those two you need to use C types like structs, chars, ints etc. It’s because the Objective-C objects are only usable in the Objective-C runtime environment and the C++ objects are only usable in the C++ runtime environment. So the only thing they both share and can communicate through is C.
Maybe a little example will show you how you can interact between these two.