OK, this makes no sense to me…it’s very strange, but I FINALLY figured out why my own application was crashing/hanging on real hardware but the Director 1.2 demo app worked fine.
I found a single change to the Director 1.2 app will reproduce this problem for me.
Go into the screen2.lua file and change the line:
[lua]local background = display.newImage(“images/background2.png”)[/lua]
to this
[lua]local background = display.newRect( 0, 0, display.contentWidth, display.contentHeight)
background:setFillColor( 0,0,250)[/lua]
That’s it. Just changing the background from an image to a solid blue rectangle.
Now, build this and put it on actual hardware. For this test I was using an original iPod touch running iOS 3.1.3. Also tested on Android with a DroidX running 2.2.
If you repeatedly tap the moveFromLeft button and then tap the screen to return and keep doing this 10-20 times, eventually the app will either hang or just exit
Now, you’ll notice that in Screen2, the background is where the addEventListener is being added. This is important. If you simply add a rectangle to the screen, but still add the event listener to the IMAGE, then it will still work. It’s adding the touch listener to the RECTANGLE that causes the problem.
Maybe it’s because of a difference in how images are cached internally to Corona. I have no idea. Maybe somebody else can explain why changing the background from an image to a rectangle would make such a big difference on actual hardware.
(remember: works fine in the Simulator. You need to test this on real hardware!)
[import]uid: 12529 topic_id: 6743 reply_id: 306743[/import]