I´m new to cocos2dx and programming cpp in general, so please bear with me
Trying to make a simple level design tool for my game level designer using XML. The plan is to make him edit a XML file that is on a server, setting game properties etc. The game should read this XML file at startup and set its properties accordingly.
If anyone has other approaches for making such a tool I would very much appreciate suggestions.
void LevelData::onHttpRequestCompleted(cocos2d::CCNode *sender, void *data)
It’s wrong method signature, jump to httpresponse_selector definition and you’ll see that correct signature is: void LevelData::onHttpRequestCompleted(HttpClient* client, HttpResponse* response);
Thank you Sergey. Unfortunately the problem is still there - I must be overlooking something. I checked out the example code in TestCpp/Classes/ExtensionsTest/NetworkTest and compared it with my header files and cpp files… but still xcode complains: "No matching member function for call to ‘setResponseCallback’
Found the error: the class was not inheriting from CCLayer. I´m able to read the file from the webserver, but I get a runtime error when releasing the request object:
Cocos2d: Assert failed: reference count should greater than 0
Assertion failed: (m_uReference > 0), function release, file /
is httpresponse_selector a new thing? I’m on 2.0.4 and I’m using callfuncND selector and it works
Yes, I believe it is.
Reference says: DEPRECATED_ATTRIBUTE void setResponseCallback ( CCObject * pTarget,
SEL_CallFuncND pSelector
)