I have an Objective C Class called Donald, I also have a C++ class called Donald in a static library that I would like to use in the same project. They both have a header file called Do开发者_C百科nald.h. Is there a way to do this?
You can include both header files by specifying a bit more of the path e.g.
#import "staticlibraryheaders/Donald.h"
#import "Donald.h"
However, you might find that the code won't compile since you are declaring two types both called Donald. If the compiler sees:
Donald* duck;
How does it know to type duck as a pointer to an instance of the C++ class or the Objective-C class? You might be able to fix that if the C++ class is in a C++ namespace. However, that hits the limit of my C++ knowledge.
精彩评论