2012-04-02 8 views
3

iPhoneでCocos2dとObjective-Cを使用してユニバーサルゲームを作成しています。ほぼ私のプロジェクトが完了しました。 コンソールウィンドウで実行時にこのエラーが発生しましたユニバーサルゲーム(Cocos2d + Objective-C)のアサーションエラー、iPadシミュレータ専用

iPhone4.3シミュレータとiPhone(Retina)では、ゲームは正常に動作しています。

このエラーは「iPad」シミュレータを実行するように選択した場合にのみ発生します。

私は本当にこれと混同されています..事前に感謝!

2012-04-02 13:35:55.409 David and Goliath[35671:1803] cocos2d: CCTextureCache: removing unused texture: David_Goliath_Menu-ipad.png 
[Switching to process 35671 thread 0x1803] 
2012-04-02 13:35:56.410 David and Goliath[35671:1803] cocos2d: WARNING: Image (4096 x 1024) is bigger than the supported 2048 x 2048 
2012-04-02 13:35:56.410 David and Goliath[35671:1803] cocos2d: Couldn't add image:Day_2048_768_MOUNTAINS_IPad.png in CCTextureCache 
2012-04-02 13:35:56.411 David and Goliath[35671:1803] *** Assertion failure in -[ActionLayer addChild:z:], /Users/sumitghosh/Desktop/David and Goliath Ipad 2/libs/cocos2d/CCNode.m:390 
2012-04-02 13:35:56.412 David and Goliath[35671:1803] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Argument must be non-nil' 
*** Call stack at first throw: 
(
    0 CoreFoundation      0x018b15a9 __exceptionPreprocess + 185 
    1 libobjc.A.dylib      0x021ff313 objc_exception_throw + 44 
    2 CoreFoundation      0x01869ef8 +[NSException raise:format:arguments:] + 136 
    3 Foundation       0x005c13bb -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116 
    4 David and Goliath     0x000e3fa8 -[CCNode addChild:z:] + 200 
    5 David and Goliath     0x0002d94b -[ActionLayer setBackground] + 1947 
    6 David and Goliath     0x00038454 -[ActionLayer init] + 2356 
    7 David and Goliath     0x000396ae -[ActionScene init] + 158 
    8 David and Goliath     0x000036f6 -[David_and_GoliathAppDelegate loadScenes] + 598 
    9 David and Goliath     0x00005c7b -[LoadingLayer loadScenes:] + 187 
    10 CoreFoundation      0x01821c7d __invoking___ + 29 
    11 CoreFoundation      0x01821b51 -[NSInvocation invoke] + 145 
    12 Foundation       0x005e8495 -[NSInvocationOperation main] + 51 
    13 Foundation       0x00556b76 -[__NSOperationInternal start] + 747 
    14 Foundation       0x005567ca ____startOperations_block_invoke_2 + 106 
    15 libdispatch_sim.dylib    0x02514289 _dispatch_call_block_and_release + 16 
    16 libdispatch_sim.dylib    0x0251758a _dispatch_worker_thread2 + 252 
    17 libSystem.B.dylib     0x97fda781 _pthread_wqthread + 390 
    18 libSystem.B.dylib     0x97fda5c6 start_wqthread + 30 
) 
terminate called after throwing an instance of 'NSException' 
[Switching to process 35671 thread 0x207] 
Current language: auto; currently objective-c 
kill 
quit 
Program ended with exit code: 0 
+0

おそらくエラーメッセージの内容を読むことができますか? "警告:画像(4096 x 1024)はサポートされている2048 x 2048" –

答えて

1
2012-04-02 13:35:56.410 David and Goliath[35671:1803] cocos2d: WARNING: Image (4096 x 1024) is bigger than the supported 2048 x 2048 
2012-04-02 13:35:56.410 David and Goliath[35671:1803] cocos2d: Couldn't add image:Day_2048_768_MOUNTAINS_IPad.png in CCTextureCache 
2012-04-02 13:35:56.411 David and Goliath[35671:1803] *** Assertion failure in -[ActionLayer addChild:z:], /Users/sumitghosh/Desktop/David and Goliath Ipad 2/libs/cocos2d/CCNode.m:390 
2012-04-02 13:35:56.412 David and Goliath[35671:1803] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Argument must be non-nil' 

ここはあなたの問題を語っています。 iPadがサポートできる最大の大きさを超えるイメージを読み込もうとしているので、cocos2dは読み込めません。 CCSpriteとして追加しようとすると、未処理のNSInternalInconsistencyException(ノードがnilなので)がトリガーされ、これによりアプリが終了します。

iPadの場合は、より小さい画像を使用する必要があります。

+1

よりも大きいです@DavbrynとNick Bull、どちらも正しいです..私はあなたに提案を使って解決策を得ました:-) – NSExpression

関連する問題