CCSpriteFrameCache crash when adding frames


#1

I am attempting to use CCSpriteFrameCache instead of just loading my images from files seperatly. I am using texturepacker to produce 2 files called
sprites.plst and
sprites.png

I then use these 2 lines of code to try to load them in the init function of my scene…
CCSpriteFrameCache::sharedSpriteFrameCache()>init;
CCSpriteFrameCache::sharedSpriteFrameCache
>addSpriteFramesWithFile;
When I do the program crashes with a exc_bad_access error. The source of the error is CCSpriteFrameCache::addSpriteFramesWithDictionary line 101. Here…
<pre>
void CCSpriteFrameCache::addSpriteFramesWithDictionary
{
/*
Supported Zwoptex Formats:
ZWTCoordinatesFormatOptionXMLLegacy = 0, // Flash Version
ZWTCoordinatesFormatOptionXML1_0 = 1, // Desktop Version 0.0~~ 0.4b
ZWTCoordinatesFormatOptionXML1_1 = 2, // Desktop Version 1.0.0~~ 1.0.1
ZWTCoordinatesFormatOptionXML1_2 = 3, // Desktop Version 1.0.2+
/
CCDictionary
metadataDict = (CCDictionary*)dictionary~~>objectForKey;
CCDictionary *framesDict = dictionary~~>objectForKey(“frames”);
int format = 0;

// get the format
if(metadataDict != NULL)
{
format = metadataDict->valueForKey(“format”)~~>intValue;
}
// check the format
CCAssert;
CCDictElement* pElement = NULL;
CCDICT_FOREACH <~~this is the line of the crash. framesDict is NULL which I imagine is why it’s crashing but I don’t know how to fix it.
{

I am using the latest version of cocos2dx, and I really can’t figure out whats wrong. At this point I’m guessing it’s something wrong with the way the .plst is made but seeing as I’ve read that other people here are using texturepacker to produce the .plst I’m really stumped. Hopefully I’m just doing something stupid and someone can point it out :). Thanks.