I created a background image for a game I am working on and it was working perfectly.
I then went to test on an iPad once compiled with Xcode and it crashes.
so I change the simulator to use an iPad retina and the same error occurs.
It acts like the PNG is missing…
‘NSInvalidArgumentException’, reason: ‘*** setObjectForKey: object cannot be nil (key: /Users/waynemichael/Library/Application Support/iPhone Simulator/7.0.3/Applications/8FF3F5D6-3694-40DD-98D0-7CBBBA740C8F/SpaceFlight.app/SpritePacks/Documents.spritepack/bg.png)’
*** First throw call stack:
(
0 CoreFoundation 0x0301b5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x02c3a8b6 objc_exception_throw + 44
2 CoreFoundation 0x030a5578 -[__NSDictionaryM setObject:forKey:] + 888
3 CoreFoundation 0x030aa23f -[NSMutableDictionary setObject:forKeyedSubscript:] + 47
4 SpaceFlight 0x0004a682 -[TextureCache textureForSprite:width:height:] + 317
5 SpaceFlight 0x000aab51 -[SpriteManager spriteTextureFromString:width:height:cache:] + 127
6 SpaceFlight 0x0005786c sprite + 461
7 SpaceFlight 0x000e7a75 luaD_precall + 499
8 SpaceFlight 0x000f6dfe luaV_execute + 1563
9 SpaceFlight 0x000e7e93 luaD_call + 103
10 SpaceFlight 0x000e05d4 f_call + 33
11 SpaceFlight 0x000e7628 luaD_rawrunprotected + 59
12 SpaceFlight 0x000e80e7 luaD_pcall + 69
13 SpaceFlight 0x000e0598 lua_pcall + 110
14 SpaceFlight 0x0004d7e3 -[LuaState callSimpleFunction:] + 171
15 SpaceFlight 0x00005274 -[RuntimeViewController glkView:drawInRect:] + 700
16 GLKit 0x0051ac26 -[GLKView _display:] + 303
17 GLKit 0x0051b274 -[GLKView display] + 41
18 GLKit 0x0051c0ad -[GLKViewController _updateAndDraw] + 661
19 libobjc.A.dylib 0x02c4c7d2 -[NSObject performSelector:] + 62
20 GLKit 0x0051b5fa -[GLKDisplayLinkMessenger message] + 52
21 QuartzCore 0x018aab8a _ZN2CA7Display15DisplayLinkItem8dispatchEv + 48
22 QuartzCore 0x018aaa46 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 310
23 QuartzCore 0x018aaf6b _ZN2CA7Display16TimerDisplayLink8callbackEP16__CFRunLoopTimerPv + 123
24 CoreFoundation 0x02fd9bd6 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 22
25 CoreFoundation 0x02fd95bd __CFRunLoopDoTimer + 1181
26 CoreFoundation 0x02fc1628 __CFRunLoopRun + 1816
27 CoreFoundation 0x02fc0ac3 CFRunLoopRunSpecific + 467
28 CoreFoundation 0x02fc08db CFRunLoopRunInMode + 123
29 GraphicsServices 0x039689e2 GSEventRunModal + 192
30 GraphicsServices 0x03968809 GSEventRun + 104
31 UIKit 0x019a8d3b UIApplicationMain + 1225
32 SpaceFlight 0x0000287d main + 141
33 SpaceFlight 0x000027e5 start + 53
)
libc++abi.dylib: terminating with uncaught exception of type NSException