Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8056025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:35:03+00:00 2026-06-05T08:35:03+00:00

I am developing for iPad with Cocos2D 2.0. I have these lines: [[CCSpriteFrameCache sharedSpriteFrameCache]

  • 0

I am developing for iPad with Cocos2D 2.0.

I have these lines:

[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"atlas.plist"];
CCSpriteBatchNode *batchNode = [CCSpriteBatchNode batchNodeWithFile:@"atlas.png"];
[self addChild:batchNode];

CCSprite *mySprite = [CCSprite spriteWithFrameName:@"white.png"];

it fails miserably with this error:

Cocos2d: CCSpriteFrameCache: Frame ‘white.png’ not found
*
Assertion failure in -[CCSprite initWithSpriteFrame:], /Users/myUser/Documents/MyApp/MyApp/libs/cocos2d/CCSprite.m:212**

I have generated the plist using TexturePacker. TexturePacker created 4 files: atlas-ipadhd.plis, atlas-ipadhd.png, atlas.plist and atlas.png.

white-ipadhd.png is a 2×2 white picture. white.png is a 1×1 white picture.

This is the content of atlas-ipadhd

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>frames</key>
        <dict>
            <key>white-ipadhd.png</key>
            <dict>
                <key>frame</key>
                <string>{{162,2},{2,2}}</string>
                <key>offset</key>
                <string>{0,0}</string>
                <key>rotated</key>
                <false/>
                <key>sourceColorRect</key>
                <string>{{0,0},{2,2}}</string>
                <key>sourceSize</key>
                <string>{2,2}</string>
            </dict>
            <key>bgNormal-ipadhd.png</key>
            <dict>
                <key>frame</key>
                <string>{{2,2},{348,78}}</string>
                <key>offset</key>
                <string>{0,0}</string>
                <key>rotated</key>
                <true/>
                <key>sourceColorRect</key>
                <string>{{0,0},{348,78}}</string>
                <key>sourceSize</key>
                <string>{348,78}</string>
            </dict>
            <key>bgPressed-ipadhd.png</key>
            <dict>
                <key>frame</key>
                <string>{{82,2},{348,78}}</string>
                <key>offset</key>
                <string>{0,0}</string>
                <key>rotated</key>
                <true/>
                <key>sourceColorRect</key>
                <string>{{0,0},{348,78}}</string>
                <key>sourceSize</key>
                <string>{348,78}</string>
            </dict>
        </dict>
        <key>metadata</key>
        <dict>
            <key>format</key>
            <integer>2</integer>
            <key>realTextureFileName</key>
            <string>atlas-ipadhd.png</string>
            <key>size</key>
            <string>{256,512}</string>
            <key>smartupdate</key>
            <string>$TexturePacker:SmartUpdate:f709325b7d140d102cd10dd90ef475b0$</string>
            <key>textureFileName</key>
            <string>atlas-ipadhd.png</string>
        </dict>
    </dict>
</plist>

This is atlas.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>frames</key>
        <dict>
            <key>white.png</key>
            <dict>
                <key>frame</key>
                <string>{{84,2},{1,1}}</string>
                <key>offset</key>
                <string>{0,0}</string>
                <key>rotated</key>
                <false/>
                <key>sourceColorRect</key>
                <string>{{0,0},{1,1}}</string>
                <key>sourceSize</key>
                <string>{1,1}</string>
            </dict>
            <key>bgNormal.png</key>
            <dict>
                <key>frame</key>
                <string>{{2,2},{174,39}}</string>
                <key>offset</key>
                <string>{0,0}</string>
                <key>rotated</key>
                <true/>
                <key>sourceColorRect</key>
                <string>{{0,0},{174,39}}</string>
                <key>sourceSize</key>
                <string>{174,39}</string>
            </dict>
            <key>bgPressed.png</key>
            <dict>
                <key>frame</key>
                <string>{{43,2},{174,39}}</string>
                <key>offset</key>
                <string>{0,0}</string>
                <key>rotated</key>
                <true/>
                <key>sourceColorRect</key>
                <string>{{0,0},{174,39}}</string>
                <key>sourceSize</key>
                <string>{174,39}</string>
            </dict>
        </dict>
        <key>metadata</key>
        <dict>
            <key>format</key>
            <integer>2</integer>
            <key>realTextureFileName</key>
            <string>atlas.png</string>
            <key>size</key>
            <string>{128,256}</string>
            <key>smartupdate</key>
            <string>$TexturePacker:SmartUpdate:c3c8dd4637d116b049a6b55c8ad175d0$</string>
            <key>textureFileName</key>
            <string>atlas.png</string>
        </dict>
    </dict>
</plist>

this is atlas-ipadhd.png and atlas.png

enter image description here
enter image description here

after looking at this for hours, I cannot able to find anything wrong with these files… but it still crashes catastrophically.

any clues? thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:35:04+00:00Added an answer on June 5, 2026 at 8:35 am

    the sprite frame name should be white.png in atlas-ipadhd.plist.

    straight from the horses’ mouth:

    +(id)spriteWithSpriteFrameName:(NSString*)spriteFrameName
    {
        CCSpriteFrame *frame = [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:spriteFrameName];
    
        NSAssert1(frame!=nil, @"Invalid spriteFrameName: %@", spriteFrameName);
        return [self spriteWithSpriteFrame:frame];
    }
    

    There is no attempt to correct the frame name with device specific keys. This way your code can remain completely device agnostic, you just have to provide the resources (textures and plists) with the appropriate device specific file names.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an iPad application. I have been provided with a PNG image that
I am developing an iPad/Mac app and need to store 1000 preset words. These
I have been developing an application for iPad that is very graphically intensive. I
I am a developing an iPad application in which i have to use CTRunDelegate
I am developing for iPad and have created a standard UISplitViewController application using the
I am developing an iPad application. I have an SQLite database in my resource
I'm currently developing an iPad application that integrates MapKit. But I have a small
Background: I'm developing a game for the iPhone/iPad using cocos2d-iphone. Our engine provides the
I am developing an iPad game that uses cocos2d and requires a virtual joystick.
I'm developing an iPad Web App for a client. Unfortunately I don't have an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.