How to use Objective-C in C++ header?

c++, objective-c

Solution

You're including it in a `.cpp` file? Rename it to `.mm` (that's the correct file extension for Objective-C++).

Problem

I tried to do the following in the A.h file: ``` #include "Bar.hpp" #import <Foundation/Foundation.h> namespace foo { struct A : Bar::B { public: A() : Bar::B() {} id delegate; virtual void OnEvent(...); }; } ``` But I get zillion of errors like 'I dont know what NSString is'. How do I do it correctly?

Original source