using cocos2d calls in testsAppDelegate.mm problematic in objective-c

CCMenuItemImage *adBanner = [CCMenuItemImage
                                 itemFromNormalImage:@"personalad.png"
                                 selectedImage:@"personalad.png"
                                 target:self
                                 selector:@selector(openURLforAd)];

I get testsAppDelegate.mm:175: error: ‘CCMenuItemImage’ was not declared in this scope

cocos2d::CCMenuItemImage *adBanner = [cocos2d::CCMenuItemImage
                                 itemFromNormalImage:@"personalad.png"
                                 selectedImage:@"personalad.png"
                                 target:self
                                 selector:@selector(openURLforAd)];

I get testsAppDelegate.mm:169: error: ‘CCMenuItemImage’ is not an Objective-C class name or alias

I’m trying to integrate the AdWhirl iOS SDK into the iOS side of the cocos2d-x project, but I can’t seem to figure out how to use CCMenuItemImage in testsAppDelegate.mm without putting the cocos2d:: scope operator… I see that there are cocos2d calls in testsAppDelegate.mm but they’re all in c++ format like cocos2d::CCDirector::sharedDirector()->pause();

How can I make a cocos2d function call and use cocos2d classes in this .mm file? I have already imported: #import “cocos2d.h”

Any clues would be helpful. Thanks!

Oh no, you mustn’t invoke c*+ methods in objc style.
Using .mm to mix c*+ & objc together is correct, while you must obey the c*+ rule in it.
<pre>
#include “cocos2d.h” // use include because it’s a c*+ header file
#import <UIKit/UIAlert.h> // use import because it’s an objc header.

void MyClass::foo()
{
// please obey the c++ syntax to call cocos2d-x methods
cocos2d::CCMenuItemImage adBanner = cocos2d::CCMenuItemImage::itemFromNormalImage);
}
void MyClass:openURLforAd
{
// please obey the objc syntax to call objc methods, from iOS sdk or AdWhirl SDK
UIAlertView
msgBox = [[UIAlertView alloc] initWithTitle: "MenuCallback" message:“I can invoke AdWhirl objc methods here”
delegate: nil
cancelButtonTitle: @“OK”
otherButtonTitles: nil];
[messageBox autorelease];
[messageBox show];
}

Thanks!