This forum is read only and just serves as an archive. If you have any questions, please post them on

1 decade ago by ape

I'm trying to use iOSImpact Beta with a rather complex game and have run into a snag.

I'm seeing this error:

Mon Jun 13 21:35:12 m.home iOSImpact[4998] <Error>: CGContextDrawImage: invalid context 0x0

Shortly after seeing that the game crashes in the simulator around line 263 of iOSImpactAppDelegate.m because of an EXC_ARITHMETIC exception:

sx = (int)(t * sw) % (int)currentTexture.width;

If I inspect currentTexture.width, it's null.

Any ideas about what's going on here?

1 decade ago by paularmstrong

Sounds like it can't find a reference to the image you're trying to load. Double check that the image is in your game/media folder.

Have you tested this in a browser from non-iOSImpact as well?

Also, there is no line 263 in iOSImpactAppDelegate. Can you past some more of the gdb logs in?

1 decade ago by ape

I've done some more tinkering with this.

I can't say for sure yet, but I think it might have something to do with the sprite sheet size.

I have verified that the same sprite sheet works in non-iOSImpact. In fact, my iOSImpact project symlinks to the same code that runs in the browser. In the browser, it checks to see if we're running in iOS or not and avoids loading the iOS plugin if we're in the browser.

I'll do some more in depth trial and error with the sprite sheets to see if my hunch is correct.

1 decade ago by ape

Also, I meant to say the error was happening on line 263 of JS_Canvas.m.

1 decade ago by ape

Someone needs to revoke my programming license.

The issue, was in fact, that images couldn't be found.

I mentioned that I was using symlinks in my iOSImpact project that pointed to my normal Impact project. It turns out I wasn't properly pointing to my media directory. There was a media directory there with some old files which meant that some sprites worked, some didn't.

The lesson learned: trust paularmstrong's first instinct.

1 decade ago by paularmstrong

:-D Take that lesson with a grain of salt.

Glad it's working for you now!
Page 1 of 1
« first « previous next › last »