all.
I added my picture "Icon2222.png" into my project, and changed the name of picture from "grossini.png"(which is original) to "Icon2222.png",
but when I run the project, it crashed with the exception named NSInternalInconsistencyException and hint me that "Can't create Texture. UIImage is nil".
Where did I make a mistake? I just replaced a picture.
Thanks in advance.
2012-05-03 14:59:10.480 ActionManagerTest[3215:f803] cocos2d: cocos2d v1.0.1
2012-05-03 14:59:10.481 ActionManagerTest[3215:f803] cocos2d: Using Director Type:CCDirectorDisplayLink
2012-05-03 14:59:10.529 ActionManagerTest[3215:f803] cocos2d: OS version: 5.0 (0x05000000)
2012-05-03 14:59:10.529 ActionManagerTest[3215:f803] cocos2d: GL_VENDOR: Apple Computer, Inc.
2012-05-03 14:59:10.530 ActionManagerTest[3215:f803] cocos2d: GL_RENDERER: Apple Software Renderer
2012-05-03 14:59:10.531 ActionManagerTest[3215:f803] cocos2d: GL_VERSION: OpenGL ES-CM 1.1 APPLE
2012-05-03 14:59:10.531 ActionManagerTest[3215:f803] cocos2d: GL_MAX_TEXTURE_SIZE: 4096
2012-05-03 14:59:10.532 ActionManagerTest[3215:f803] cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16
2012-05-03 14:59:10.532 ActionManagerTest[3215:f803] cocos2d: GL_MAX_SAMPLES: 4
2012-05-03 14:59:10.533 ActionManagerTest[3215:f803] cocos2d: GL supports PVRTC: YES
2012-05-03 14:59:10.533 ActionManagerTest[3215:f803] cocos2d: GL supports BGRA8888 textures: YES
2012-05-03 14:59:10.534 ActionManagerTest[3215:f803] cocos2d: GL supports NPOT textures: YES
2012-05-03 14:59:10.535 ActionManagerTest[3215:f803] cocos2d: GL supports discard_framebuffer: YES
2012-05-03 14:59:10.535 ActionManagerTest[3215:f803] cocos2d: compiled with NPOT support: NO
2012-05-03 14:59:10.536 ActionManagerTest[3215:f803] cocos2d: compiled with VBO support in TextureAtlas : YES
2012-05-03 14:59:10.536 ActionManagerTest[3215:f803] cocos2d: compiled with Affine Matrix transformation in CCNode : YES
2012-05-03 14:59:10.537 ActionManagerTest[3215:f803] cocos2d: compiled with Profiling Support: NO
2012-05-03 14:59:10.549 ActionManagerTest[3215:f803] Retina Display Not supported
2012-05-03 14:59:10.550 ActionManagerTest[3215:f803] cocos2d: CCTexture2D. Can't create Texture. UIImage is nil
2012-05-03 14:59:10.551 ActionManagerTest[3215:f803] cocos2d: deallocing [Switching to process 3215 thread 0x12f0b]
2012-05-03 14:59:10.551 ActionManagerTest[3215:f803] cocos2d: Couldn't add image:Icon2222.png in CCTextureCache
2012-05-03 14:59:10.559 ActionManagerTest[3215:f803] cocos2d: deallocing
2012-05-03 14:59:10.559 ActionManagerTest[3215:f803] * Assertion failure in -[CCLayer addChild:], /Users/qusean/Downloads/cocos2d-iphone-1.0.1/cocos2d/CCNode.m:413
2012-05-03 14:59:10.561 ActionManagerTest[3215:f803] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Argument must be non-nil'
* First throw call stack: (0x17de052 0x14ddd0a 0x1786a78 0x1e92db 0xb300 0x4546 0x4adb0e 0x4ae8a6 0x4bd743 0x4be1f8 0x4b1aa9 0x1ed4fa9 0x17b21c5 0x1717022 0x171590a 0x1714db4 0x1714ccb 0x4ae2a7 0x4afa9b 0x2581 0x2505 0x1) terminate called throwing an exception
Here is my code:
1
CCSprite *child = [CCSprite spriteWithFile:@"Icon2222.png"];
[child setPosition:ccp(200,200)];
[layer addChild:child];
2
CGSize winSize = [[CCDirector sharedDirector] winSize];
CCSprite *player = [CCSprite spriteWithFile:@"Icon2222.png"
rect:CGRectMake(0, 0, 27, 40)];
player.position = ccp(player.contentSize.width/2, winSize.height/2);
[layer addChild:player];
Both of them crashed.
