CGImageCreate Error

I’m not sure where this error is coming from or how to get rid of it.

I have a project with three scenes: title, level, and play. The project starts at title, tapping the background moves to level. From level you can choose a level and go to play and then back to level.

Changing from play to level and back any number of times produces no error.

Going from level to title the first time produces no error. Doing this a second time produces a long error message including the line: CGImageCreate Error.

When the error occurs the title page looks fine. But I get the error on each transition.
[import]uid: 98652 topic_id: 27301 reply_id: 327301[/import]

Hmmm very strange. I added a few print statements to follow the flow. The scenes are named:

title, choose and game.

You can see that there is no error moving from title > to choose > to game or back to choose. Going from choose > to title produces the error.

Here’s where things look funny. I get most of the error, then see the print statement “title exit scene”, this is before the enter scene event for that scene. Then I see title enter scene twice?

Continuing back and forth between title and choose will double the enter scene events, coming from title, each time.

title create scene
title enter scene
title exit scene
Choose create scene
choose enter scene
choose exit scene
Game create scene
Game Enter scene
Game Exit scene
choose enter scene
choose exit scene
Jun 8 21:33:30 mitchells-MacBook-Air.local Corona Simulator[6804] : CGImageCreate: invalid image width.
Jun 8 21:33:30 mitchells-MacBook-Air.local Corona Simulator[6804] : CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 8 bits/pixel; 0-component color space; kCGImageAlphaNoneSkipFirst; 0 bytes/row.
Jun 8 21:33:30 mitchells-MacBook-Air.local Corona Simulator[6804] : CGContextDrawImage: invalid context 0x0
Jun 8 21:33:30 mitchells-MacBook-Air.local Corona Simulator[6804] : CGBitmapContextCreateImage: invalid context 0x0
ImageIO: CGImageDestinationAddImage image parameter is nil
ImageIO: CGImageDestinationFinalize image destination does not have enough images
title exit scene *Why exit scene here?
2012-06-08 21:33:30.624 Corona Simulator[6804:2403] glError at end unbindRenderFBO
title enter scene
Why enter scene twice here?
title enter scene [import]uid: 98652 topic_id: 27301 reply_id: 110955[/import]

Oops user error. Looks like the problem was not removing a tap event from the choose scene. The button in this scene leading back to title ended up having more than one tap event calling gotoscene( “title” ) [import]uid: 98652 topic_id: 27301 reply_id: 110956[/import]