我的應用程序在模擬器和其他設備上正常工作。我有最新iOS更新的iPhone 4,並且該應用拒絕在我的設備上運行。Objective C - 應用程序可以在模擬器和其他iPhone上運行,但不會在我自己的iPhone上運行4
這似乎是圍繞視網膜顯示圖像的問題。錯誤噴涌我得到試圖在手機上運行時是:
2012-01-11 09:27:47.404 rr_game1[1569:707] cocos2d: cocos2d v1.0.1
2012-01-11 09:27:47.413 rr_game1[1569:707] cocos2d: Using Director Type:CCDirectorDisplayLink
2012-01-11 09:27:47.845 rr_game1[1569:707] cocos2d: OS version: 5.0.1 (0x05000100)
2012-01-11 09:27:47.849 rr_game1[1569:707] cocos2d: GL_VENDOR: Imagination Technologies
2012-01-11 09:27:47.853 rr_game1[1569:707] cocos2d: GL_RENDERER: PowerVR SGX 535
2012-01-11 09:27:47.856 rr_game1[1569:707] cocos2d: GL_VERSION: OpenGL ES-CM 1.1 IMGSGX535-63.14.2
2012-01-11 09:27:47.861 rr_game1[1569:707] cocos2d: GL_MAX_TEXTURE_SIZE: 2048
2012-01-11 09:27:47.864 rr_game1[1569:707] cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16
2012-01-11 09:27:47.867 rr_game1[1569:707] cocos2d: GL_MAX_SAMPLES: 4
2012-01-11 09:27:47.871 rr_game1[1569:707] cocos2d: GL supports PVRTC: YES
2012-01-11 09:27:47.874 rr_game1[1569:707] cocos2d: GL supports BGRA8888 textures: YES
2012-01-11 09:27:47.877 rr_game1[1569:707] cocos2d: GL supports NPOT textures: YES
2012-01-11 09:27:47.880 rr_game1[1569:707] cocos2d: GL supports discard_framebuffer: YES
2012-01-11 09:27:47.883 rr_game1[1569:707] cocos2d: compiled with NPOT support: NO
2012-01-11 09:27:47.886 rr_game1[1569:707] cocos2d: compiled with VBO support in TextureAtlas : YES
2012-01-11 09:27:47.889 rr_game1[1569:707] cocos2d: compiled with Affine Matrix transformation in CCNode : YES
2012-01-11 09:27:47.892 rr_game1[1569:707] cocos2d: compiled with Profiling Support: NO
2012-01-11 09:27:48.012 rr_game1[1569:707] Game manager singleton, init
2012-01-11 09:27:48.031 rr_game1[1569:707] cocos2d: WARNING: Image (1024 x 4096) is bigger than the supported 2048 x 2048
2012-01-11 09:27:48.035 rr_game1[1569:707] cocos2d: Couldn't add image:grid.png in CCTextureCache
2012-01-11 09:27:48.047 rr_game1[1569:707] cocos2d: WARNING: Image (1024 x 4096) is bigger than the supported 2048 x 2048
2012-01-11 09:27:48.050 rr_game1[1569:707] cocos2d: Couldn't add image:bg-circuits.png in CCTextureCache
2012-01-11 09:27:48.054 rr_game1[1569:707] *** Assertion failure in -[CCParallaxNode addChild:z:parallaxRatio:positionOffset:], /Users/kevin/code/rr_game1/rr_game1/libs/cocos2d/CCParallaxNode.m:91
2012-01-11 09:27:48.058 rr_game1[1569:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Argument must be non-nil'
奇怪的是,它是令人作嘔的圖像是在應用程序。
再次,應用程式適用於其它設備和在模擬器。下面是加載圖像的代碼:
backgroundNode = [CCParallaxNode node];
[self addChild:_backgroundNode z:-1];
_backgroundGrid1 = [CCSprite spriteWithFile:@"grid.png"];
_backgroundCircuits1 = [CCSprite spriteWithFile:@"bg-circuits.png"];
_backgroundGrid1.anchorPoint = CGPointMake(0,0);
_backgroundCircuits1.anchorPoint = CGPointMake(0,0);
CGPoint gridSpeed = ccp(0.05, 0.05);
CGPoint circuitSpeed = ccp(0.1, 0.1);
[_backgroundNode addChild:_backgroundGrid1 z:1 parallaxRatio:gridSpeed positionOffset:ccp(0,-winSize.height)];
[_backgroundNode addChild:_backgroundCircuits1 z:0 parallaxRatio:circuitSpeed positionOffset:ccp(0,-winSize.height)];
我已經刪除了我的手機應用程序,運行一個「乾淨」的Xcode重新啓動,並重新啓動我的電腦。仍然沒有運氣。我也重新配置了我的手機。我也刪除並重新添加資產到項目中。
它說的圖片太大的幫助旁邊。奇怪的是,這隻發生在iPhone 4上...... – evotopid 2012-01-11 15:37:24
請勿在cocos2d中使用@ 2x擴展名。改爲使用-hd後綴。請參閱:http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:how_to_develop_retinadisplay_games_in_cocos2d – LearnCocos2D 2012-01-11 20:34:02