On Dec 17, 2009, at 11:24 AM, Randall Meadows wrote:

> Just like that.  Put this into a .mm file, and it'll compile as 
> Objective-C++.  You'll get a compiler warning that objcptr may not respond to 
> updateText, which you can eliminate by casting objcptr to the appropriate 
> class.

Or better, declare objcptr as the appropriate Obj-C type in the class 
declaration. This is problematic if your class header is #included by other C++ 
source files and you don't want to change them all to Obj-C++, but you can fix 
it with some #ifdefs:

#ifdef __OBJC__
#import "MyClass.h"
#else
struct MyClass;
#endif

...
        MyClass* objcptr;

—Jens_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to