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 6152235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:53:09+00:00 2026-05-23T19:53:09+00:00

I am using following code to render the image on screen -(id) init {

  • 0

I am using following code to render the image on screen

-(id) init
{
    if( (self=[super init] )) {
        CGSize winSize = [[CCDirector sharedDirector] winSize];
        CCSprite *player = [CCSprite spriteWithFile:@"Player.png" rect:CGRectMake(0, 0, 27, 40)];
        player.position = ccp(player.contentSize.width/2, winSize.height/2);
        [self addChild:player];     
    }
    return self;
}

when I ran the code following error is coming

continue
2011-07-11 19:25:58.220 testcellapp[441:707] cocos2d: cocos2d v1.0.0-rc3
2011-07-11 19:25:58.229 testcellapp[441:707] cocos2d: Using Director Type:CCDirectorDisplayLink
2011-07-11 19:25:58.407 testcellapp[441:707] cocos2d: OS version: 4.3.1 (0x04030100)
2011-07-11 19:25:58.411 testcellapp[441:707] cocos2d: GL_VENDOR:   Imagination         Technologies
2011-07-11 19:25:58.415 testcellapp[441:707] cocos2d: GL_RENDERER: PowerVR SGX 535
2011-07-11 19:25:58.418 testcellapp[441:707] cocos2d: GL_VERSION:  OpenGL ES-CM 1.1       IMGSGX535-58.6
2011-07-11 19:25:58.423 testcellapp[441:707] cocos2d: GL_MAX_TEXTURE_SIZE: 2048
2011-07-11 19:25:58.427 testcellapp[441:707] cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16
2011-07-11 19:25:58.430 testcellapp[441:707] cocos2d: GL_MAX_SAMPLES: 4
2011-07-11 19:25:58.434 testcellapp[441:707] cocos2d: GL supports PVRTC: YES
2011-07-11 19:25:58.437 testcellapp[441:707] cocos2d: GL supports BGRA8888 textures: YES
2011-07-11 19:25:58.441 testcellapp[441:707] cocos2d: GL supports NPOT textures: YES
2011-07-11 19:25:58.444 testcellapp[441:707] cocos2d: GL supports discard_framebuffer: YES
2011-07-11 19:25:58.447 testcellapp[441:707] cocos2d: compiled with NPOT support: NO
2011-07-11 19:25:58.450 testcellapp[441:707] cocos2d: compiled with VBO support in TextureAtlas : NO
2011-07-11 19:25:58.454 testcellapp[441:707] cocos2d: compiled with Affine Matrix transformation in CCNode : YES
2011-07-11 19:25:58.457 testcellapp[441:707] cocos2d: compiled with Profiling Support: NO
2011-07-11 19:25:58.554 testcellapp[441:707] cocos2d: CCTexture2D. Can't create Texture. UIImage is nil
2011-07-11 19:25:58.558 testcellapp[441:707] cocos2d: Couldn't add image:Player.png in CCTextureCache
2011-07-11 19:25:58.564 testcellapp[441:707] *** Assertion failure in -[HelloWorldLayer addChild:], /Users/shahbazali/Documents/testcellapp/libs/cocos2d/CCNode.m:408
2011-07-11 19:25:58.601 testcellapp[441:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Argument must be non-nil'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x32c3064f __exceptionPreprocess + 114
    1   libobjc.A.dylib                     0x31da4c5d objc_exception_throw + 24
    2   CoreFoundation                      0x32c30491 +[NSException raise:format:arguments:] + 68
    3   Foundation                          0x318a2573 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 62
    4   testcellapp                         0x00067c1c -[CCNode addChild:] + 196
    5   testcellapp                         0x000033ec -[HelloWorldLayer init] + 400
    6   testcellapp                         0x00066ca0 +[CCNode node] + 76
    7   testcellapp                         0x000031fc +[HelloWorldLayer scene] + 100
    8   testcellapp                         0x00002aac -[testcellappAppDelegate applicationDidFinishLaunching:] + 1028
    9   UIKit                               0x32f6a85d -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 832
    10  UIKit                               0x32f64b65 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 272
    11  UIKit                               0x32f397d7 -[UIApplication handleEvent:withNewEvent:] + 1114
    12  UIKit                               0x32f39215 -[UIApplication sendEvent:] + 44
    13  UIKit                               0x32f38c53 _UIApplicationHandleEvent + 5090
    14  GraphicsServices                    0x31118e77 PurpleEventCallback + 666
    15  CoreFoundation                      0x32c07a97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
    16  CoreFoundation                      0x32c0983f __CFRunLoopDoSource1 + 166
    17  CoreFound

Please help why this error is coming

  • 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-23T19:53:10+00:00Added an answer on May 23, 2026 at 7:53 pm

    [CCNode addChild:] uses an NSAssert to let you know that the argument is not allowed to be nil.
    Make sure player is not nil.

    Also note the lines in the log before the crash.

    cocos2d: CCTexture2D. Can’t create Texture. UIImage is nil
    cocos2d: Couldn’t add image:Player.png in CCTextureCache

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

Sidebar

Related Questions

I am using following code to render a JPEG file, which is on disk,
I'm using the following code to render an editor for my model using ASP.NET
The following bit of code catches the EOS Exception using (var reader = new
Using the following code I get a nice formatted string: Request.QueryString.ToString Gives me something
I'm using the following code to query a database from my jsp, but I'd
I've been using the following code to open Office Documents, PDF, etc. on my
I am using following PHP code to connect to MS Access database: $odb_conn =
I am currently using the following code to create a web request: Dim myRequest
I'm using the following code within the JCProperty class to retrieve data from a
I'm using the following code, using the SharpZipLib library, to add files to a

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.