help !!!cocos2d-x2.0.4 Get data from file(xxx.png)faild!

CCNodeLoaderLibrary * ccNodeLoaderLibrary = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();

ccNodeLoaderLibrary~~>registerCCNodeLoader);
/* Create an autorelease CCBReader. /
cocos2d::extension::CCBReader
ccbReader = new cocos2d::extension::CCBReader;
/* Read a ccbi file. */
m_pTempLayer = ccbReader~~>readNodeGraphFromFile(“images/ui/testsprite.ccbi”, this);

ccbReader->release();

Load cocosbuilder make an error occurred when the UI
Resource path are no problem

help

I think it is because the file path in ccbi is wrong.
Could you paste the error message?

Could you tell me what the error was?
And which Cocosbuilder version you are using?
Did TestCpp/ExtensionsTest/CocosBuilderTest also crashed?

I use cocosbuilder version is 2.1, cocos2d - x version is 2.0.4

error message:Get data from file(xxx.png)faild!

Breakpoint tracking:

CCFileUtils::getFileData methods。
unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* pszMode, unsigned long* pSize)
{
unsigned char* pBuffer = NULL;
CCAssert(pszFileName = NULL && pszMode != NULL, “Invaild parameters.”);
pSize = 0;
do
{
// read the file from hardware
FILE
fp = fopen(pszFileName, pszMode);
CC_BREAK_IF(!fp);

fseek(fp,0,SEEK_END);
**pSize = ftell;
fseek;
pBuffer = new unsigned char;
**pSize = fread(pBuffer,sizeof(unsigned char), *pSize,fp);
fclose(fp);
} while (0);

if (! pBuffer && isPopupNotify())
{
std::string title = “Notification”;
std::string msg = “Get data from file(”;
msg.append(pszFileName).append(“) failed!”);

CCMessageBox(msg.c_str(), title.c_str());
}
return pBuffer;
}

this pbuffer is NULL!

My solution is very funny:Will resource to copy to Resourcer root directory, modify the code CCB path, operation can success.
After the success of the code again the CCB path change back to the original point good kind of path, again running will not have the mistake.

This problem card me two days, to at present although can continue to develop project. But didn’t find the real reason. But is necessarily and path have relationship!

I met a new problem, I added a few interface, the same code.
But some interface using CCControlButton is correct, some interface but tip: Skipping selector “XXXX” since no CCBSelectorResolver is present.
Contrast many times TestCpp, found nothing different…

lukey liu wrote:

I met a new problem, I added a few interface, the same code.
But some interface using CCControlButton is correct, some interface but tip: Skipping selector “XXXX” since no CCBSelectorResolver is present.
Contrast many times TestCpp, found nothing different…

Skipping selector “XXXX” since no CCBSelectorResolver is present. I have this problem too! I created a menu with a button by the cocosbuilder and bound a selector on the button. But when I run the project in xcode and the error came out…

Did you solve it yet? Or anyone any sugestion?

无尘 仙剑 wrote:

lukey liu wrote:
> I met a new problem, I added a few interface, the same code.
> But some interface using CCControlButton is correct, some interface but tip: Skipping selector “XXXX” since no CCBSelectorResolver is present.
> Contrast many times TestCpp, found nothing different…
>
Skipping selector “XXXX” since no CCBSelectorResolver is present. I have this problem too! I created a menu with a button by the cocosbuilder and bound a selector on the button. But when I run the project in xcode and the error came out…
>
Did you solve it yet? Or anyone any sugestion?

have you solved it ? then I have met same error with you, thanks.
I checked the function name and call-back function is all right.so weird.

you should put your png file under the Resources file.