Hello, I try to test createUser with the latest cocos2d-x api (1.7.1). But compiler gives an error as:
"Reference to non-static member function must be called".
What is the mistake? Thanks.
My header:
class HelloWorld : public cocos2d::Layer, public App42CallBack
{
public:
void testUserService();
// a selector callback
void onUserRequestCompleted(void *response);
};
#endif // __HELLOWORLD_SCENE_H__
My Implementation:
void HelloWorld::testUserService()
{
std::string userName = "Enter_your_user_name";
std::string password = "Password";
std::string emailId = "Email_Id";
App42API::Initialize(APP_Key, SECRET_Key);
UserService *userService = App42API::BuildUserService();
userService->CreateUser(userName, password, emailId, app42CallBack(HelloWorld::onUserRequestCompleted));
}
void HelloWorld::onUserRequestCompleted(void *response)
{
App42UserResponse *userResponse = (App42UserResponse*)response;
. . .
}