title: Cocos2d 2.0 - cannot find spriteFrame?
body: <p>I am developing for iPad with Cocos2D 2.0.</p>
  
  <p>I have these lines:</p>
  
  <pre><code>[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"atlas.plist"];
  CCSpriteBatchNode *batchNode = [CCSpriteBatchNode batchNodeWithFile:@"atlas.png"];
  [self addChild:batchNode];
  
  CCSprite *mySprite = [CCSprite spriteWithFrameName:@"white.png"];
  </code></pre>
  
  <p>it fails miserably with this error:</p>
  
  <p><strong>Cocos2d: CCSpriteFrameCache: Frame 'white.png' not found
  *</strong> Assertion failure in -[CCSprite initWithSpriteFrame:], /Users/myUser/Documents/MyApp/MyApp/libs/cocos2d/CCSprite.m:212**</p>
  
  <p>I have generated the plist using TexturePacker. TexturePacker created 4 files: atlas-ipadhd.plis, atlas-ipadhd.png, atlas.plist and atlas.png. </p>
  
  <p><strong>white-ipadhd.png is a 2x2 white picture. white.png is a 1x1 white picture.</strong></p>
  
  <p>This is the content of atlas-ipadhd</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
      &lt;dict&gt;
          &lt;key&gt;frames&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;white-ipadhd.png&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;frame&lt;/key&gt;
                  &lt;string&gt;{{162,2},{2,2}}&lt;/string&gt;
                  &lt;key&gt;offset&lt;/key&gt;
                  &lt;string&gt;{0,0}&lt;/string&gt;
                  &lt;key&gt;rotated&lt;/key&gt;
                  &lt;false/&gt;
                  &lt;key&gt;sourceColorRect&lt;/key&gt;
                  &lt;string&gt;{{0,0},{2,2}}&lt;/string&gt;
                  &lt;key&gt;sourceSize&lt;/key&gt;
                  &lt;string&gt;{2,2}&lt;/string&gt;
              &lt;/dict&gt;
              &lt;key&gt;bgNormal-ipadhd.png&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;frame&lt;/key&gt;
                  &lt;string&gt;{{2,2},{348,78}}&lt;/string&gt;
                  &lt;key&gt;offset&lt;/key&gt;
                  &lt;string&gt;{0,0}&lt;/string&gt;
                  &lt;key&gt;rotated&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;sourceColorRect&lt;/key&gt;
                  &lt;string&gt;{{0,0},{348,78}}&lt;/string&gt;
                  &lt;key&gt;sourceSize&lt;/key&gt;
                  &lt;string&gt;{348,78}&lt;/string&gt;
              &lt;/dict&gt;
              &lt;key&gt;bgPressed-ipadhd.png&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;frame&lt;/key&gt;
                  &lt;string&gt;{{82,2},{348,78}}&lt;/string&gt;
                  &lt;key&gt;offset&lt;/key&gt;
                  &lt;string&gt;{0,0}&lt;/string&gt;
                  &lt;key&gt;rotated&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;sourceColorRect&lt;/key&gt;
                  &lt;string&gt;{{0,0},{348,78}}&lt;/string&gt;
                  &lt;key&gt;sourceSize&lt;/key&gt;
                  &lt;string&gt;{348,78}&lt;/string&gt;
              &lt;/dict&gt;
          &lt;/dict&gt;
          &lt;key&gt;metadata&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;format&lt;/key&gt;
              &lt;integer&gt;2&lt;/integer&gt;
              &lt;key&gt;realTextureFileName&lt;/key&gt;
              &lt;string&gt;atlas-ipadhd.png&lt;/string&gt;
              &lt;key&gt;size&lt;/key&gt;
              &lt;string&gt;{256,512}&lt;/string&gt;
              &lt;key&gt;smartupdate&lt;/key&gt;
              &lt;string&gt;$TexturePacker:SmartUpdate:f709325b7d140d102cd10dd90ef475b0$&lt;/string&gt;
              &lt;key&gt;textureFileName&lt;/key&gt;
              &lt;string&gt;atlas-ipadhd.png&lt;/string&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p><strong>This is atlas.plist</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
      &lt;dict&gt;
          &lt;key&gt;frames&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;white.png&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;frame&lt;/key&gt;
                  &lt;string&gt;{{84,2},{1,1}}&lt;/string&gt;
                  &lt;key&gt;offset&lt;/key&gt;
                  &lt;string&gt;{0,0}&lt;/string&gt;
                  &lt;key&gt;rotated&lt;/key&gt;
                  &lt;false/&gt;
                  &lt;key&gt;sourceColorRect&lt;/key&gt;
                  &lt;string&gt;{{0,0},{1,1}}&lt;/string&gt;
                  &lt;key&gt;sourceSize&lt;/key&gt;
                  &lt;string&gt;{1,1}&lt;/string&gt;
              &lt;/dict&gt;
              &lt;key&gt;bgNormal.png&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;frame&lt;/key&gt;
                  &lt;string&gt;{{2,2},{174,39}}&lt;/string&gt;
                  &lt;key&gt;offset&lt;/key&gt;
                  &lt;string&gt;{0,0}&lt;/string&gt;
                  &lt;key&gt;rotated&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;sourceColorRect&lt;/key&gt;
                  &lt;string&gt;{{0,0},{174,39}}&lt;/string&gt;
                  &lt;key&gt;sourceSize&lt;/key&gt;
                  &lt;string&gt;{174,39}&lt;/string&gt;
              &lt;/dict&gt;
              &lt;key&gt;bgPressed.png&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;frame&lt;/key&gt;
                  &lt;string&gt;{{43,2},{174,39}}&lt;/string&gt;
                  &lt;key&gt;offset&lt;/key&gt;
                  &lt;string&gt;{0,0}&lt;/string&gt;
                  &lt;key&gt;rotated&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;sourceColorRect&lt;/key&gt;
                  &lt;string&gt;{{0,0},{174,39}}&lt;/string&gt;
                  &lt;key&gt;sourceSize&lt;/key&gt;
                  &lt;string&gt;{174,39}&lt;/string&gt;
              &lt;/dict&gt;
          &lt;/dict&gt;
          &lt;key&gt;metadata&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;format&lt;/key&gt;
              &lt;integer&gt;2&lt;/integer&gt;
              &lt;key&gt;realTextureFileName&lt;/key&gt;
              &lt;string&gt;atlas.png&lt;/string&gt;
              &lt;key&gt;size&lt;/key&gt;
              &lt;string&gt;{128,256}&lt;/string&gt;
              &lt;key&gt;smartupdate&lt;/key&gt;
              &lt;string&gt;$TexturePacker:SmartUpdate:c3c8dd4637d116b049a6b55c8ad175d0$&lt;/string&gt;
              &lt;key&gt;textureFileName&lt;/key&gt;
              &lt;string&gt;atlas.png&lt;/string&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>this is atlas-ipadhd.png and atlas.png</p>
  
  <p><img src="https://i.stack.imgur.com/TtVEt.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/2ZAdI.png" alt="enter image description here"></p>
  
  <p>after looking at this for hours, I cannot able to find anything wrong with these files... but it still crashes catastrophically. </p>
  
  <p>any clues? thanks.</p>