CCApplication::sharedApplication() - Not working

Hi everyone,

I’m trying to get a value from the delegate class - people have said on the forum to use the following code

AppDelegate* p_delegate = (AppDelegate*)&CCApplication::sharedApplication();

However, when I compile the game I get the following error:

“lvalue required as unary ‘&’ operand”

Any ideas? :slight_smile:

In recent cocos2d-x (2.0+) sharedApplication() returns pointer so no need in & operator.

That worked perfectly :slight_smile: - Thank you really appreciate it :slight_smile: