Calling Objective-c functions from C++

I am trying to integrate Facebook plugin (objective-C) with cocos2dx.
I can successfully run the code in application didFinishLaunchingWithOptions inside AppController.mm

This code runs when the application starts (in objective-c), but how do I invoke this code from a CCScene or a CCLayer (in .cpp instead of .mm) ?

Thanks!

May be you should do like this:

// xxx.h
class FacebookPlug
{
   // some functions 
};

// xxx.mm, invoke the objective-c to implement it

Then, other c*+ code can include xxx.h, and use it like a normal c*+ class.

I’m not sure what Zhang means… did you get this to work?… i’d like to know this also.

You can refer
CocosDenshion/include/SimpleAudioEngine.h
CocosDenshion/iphone/SimpleAudioEngine.mm

Got it, thanks for that.