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

  • SEARCH
  • Home
  • 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 5930957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:37:36+00:00 2026-05-22T14:37:36+00:00

I’m trying to test a Cocos2D app on an iPhone, and get this crash

  • 0

I’m trying to test a Cocos2D app on an iPhone, and get this crash that I copied from the console:

    cocos2d: CCSpriteFrameCache: Trying to use file 'heroTestSheet.png' as texture
    cocos2d: CCTexture2D. Can't create Texture. UIImage is nil
    cocos2d: Couldn't add image:heroTestSheet.png in CCTextureCache
    cocos2d: CCSpriteFrameCache: Couldn't load texture
    cocos2d: CCTexture2D. Can't create Texture. UIImage is nil
    cocos2d: Couldn't add image:heroTestSheet.png in CCTextureCache
    cocos2d: CCSpriteFrameCache: Frame 'heroFrame1.png' not found
    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSMutableArray insertObject:atIndex:]: attempt to insert nil object at 0'
    *** Call stack at first throw:
    (
0   CoreFoundation                      0x3759dc7b __exceptionPreprocess + 114
1   libobjc.A.dylib                     0x32d9bee8 objc_exception_throw + 40
2   CoreFoundation                      0x3752a951 -[__NSArrayM insertObject:atIndex:] + 136
3   CoreFoundation                      0x3752a8bf -[__NSArrayM addObject:] + 34
4   cocosTests                          0x0000ce28 -[HeroClass init] + 1544
5   cocosTests                          0x0000304c -[DebugZoneLayer init] + 860
6   cocosTests                          0x00074e04 +[CCNode node] + 76
7   cocosTests                          0x0000c4e4 -[DebugZoneScene init] + 244
8   cocosTests                          0x00074e04 +[CCNode node] + 76
9   cocosTests                          0x0000c390 +[DebugZoneScene scene] + 100
10  cocosTests                          0x00002540 -[cocosTestsAppDelegate applicationDidFinishLaunching:] + 1028
11  UIKit                               0x3592502c -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1200
12  UIKit                               0x3591ea78 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 396
13  UIKit                               0x358d82e4 -[UIApplication handleEvent:withNewEvent:] + 1476
14  UIKit                               0x358d7b1c -[UIApplication sendEvent:] + 68
15  UIKit                               0x358d73b4 _UIApplicationHandleEvent + 6824
16  GraphicsServices                    0x33e77c88 PurpleEventCallback + 1048
17  CoreFoundation                      0x3752f5cb __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 28
18  CoreFoundation                      0x3752f589 __CFRunLoopDoSource1 + 164
19  CoreFoundation                      0x37521835 __CFRunLoopRun + 580
20  CoreFoundation                      0x3752150b CFRunLoopRunSpecific + 226
21  CoreFoundation                      0x37521419 CFRunLoopRunInMode + 60
22  UIKit                               0x3591d554 -[UIApplication _run] + 548
23  UIKit                               0x3591a558 UIApplicationMain + 972
24  cocosTests                          0x000020c4 main + 100
25  cocosTests                          0x0000205c start + 40
    )
    terminate called after throwing an instance of 'NSException'
    Program received signal:  “SIGABRT”.
    warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).

Running it in the simulator runs fine, but I still get this message in the console when it starts up “CCSpriteFrameCache: Trying to use file ‘heroTestSheet.png’ as texture“

I suspect that’s where the problem starts. Maybe I’m just understanding how my code for my hero sprite subclass should be written. I thought heroTestSheet.png was the texture it was relying on to split up into other images referencing the plist.

Here’s my init in my hero subclass:

    -(id) init{
    self = [super init];
    if (!self) {
        return nil;
    }

    _collisWidthFromCtr  = 16;
    _collisHeightFromCtr = 16;

    _collisPushPointsNums = 5;

    _travelRectCenterPoints = [[NSMutableArray alloc] init];

    _collisPushPoints = [[NSMutableArray alloc] init];

    [_collisPushPoints insertObject:[NSValue valueWithCGPoint:CGPointMake( _collisWidthFromCtr, _collisHeightFromCtr)] atIndex:0];
    [_collisPushPoints insertObject:[NSValue valueWithCGPoint:CGPointMake( _collisWidthFromCtr,                    0)] atIndex:1];
    [_collisPushPoints insertObject:[NSValue valueWithCGPoint:CGPointMake( _collisWidthFromCtr,-_collisHeightFromCtr)] atIndex:2];
    [_collisPushPoints insertObject:[NSValue valueWithCGPoint:CGPointMake( 0,                   _collisHeightFromCtr)] atIndex:3];
    [_collisPushPoints insertObject:[NSValue valueWithCGPoint:CGPointMake(-_collisWidthFromCtr, _collisHeightFromCtr)] atIndex:4];

    _rectCheckRes = 32;

    _speed = 8;

    [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"heroTestSheet.plist"];

    _heroSpriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"heroTestSheet.png"];

    //[self addChild:_heroSpriteSheet];

    NSMutableArray *heroSpriteFlyAnimFrames = [NSMutableArray array];
    for(int i = 1; i <= 2; ++i) {
        [heroSpriteFlyAnimFrames addObject:
         [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:
          [NSString stringWithFormat:@"heroFrame%d.png", i]]];
    }

    CCAnimation *heroSpriteFlyAnim = [CCAnimation animationWithFrames:heroSpriteFlyAnimFrames delay:0.03f];

    _heroSprite = [CCSprite spriteWithSpriteFrameName:@"heroFrame1.png"];  

    _heroSpriteFlyAction = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:heroSpriteFlyAnim restoreOriginalFrame:NO]];
    [_heroSprite runAction:_heroSpriteFlyAction];

    [_heroSpriteSheet addChild:_heroSprite];

    return self;
}

Please excuse me if I’m being unclear, so let me know any other info I need to provide. Just posting this for now because I don’t know where else to start to solve it and what other info I should provide, and it might be obvious to some other cocos devs whats wrong from what I posted. 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-05-22T14:37:37+00:00Added an answer on May 22, 2026 at 2:37 pm

    Figured it out.. it was just the heroTestSheet.png it was trying to use was somehow invalid. I exported in an older photoshop, but I’m not really positive what settings it had. I exported it again from a newer photoshop without any color mange settings, and now it works fine!

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.