Corona freezes on simple program -what's the cause?

I just installed Corona Game Edition and tried to create a simple clock using the clock tutorial as found on the web. However, when I launch main.lua in the simulator, it shows… nothing! Just a black screen.

When launching it in the debugger, the iPhone simulator freezes completely. I have to shut it down forcefully. The debugger does not say anything. I assumed that the debugger would say what’s wrong instead of crashing :o

Here’s my code:

[lua]local background = display.newImage(“background.png”)

local hourHand = display.newImage(“hourHand.png”, 152, 185)
local minuteHand = display.newImage(“minuteHand.png”, 152, 158)
local center = display.newImage(“center.png”, 150, 230)
local secondHand = display.newImage(“secondHand.png”, 160, 155)

hourHand:setReferencePoint (display.BottomCenterReferencePoint)
minuteHand:setReferencePoint (display.BottomCenterReferencePoint)
secondHand:setReferencePoint (display.BottomCenterReferencePoint)

local objTime = os.date("*t")
hourHand.rotation = objTime.hour * 30 + (objTime.min * 0.5)
minuteHand.rotation = objTime.min * 6
secondHand.rotation = objTime.sec * 6

objTime = nil
local function moveHands(event)
local objTime = os.date("*t")
hourHand.rotation = objTime.hour * 30 + (obTime.min * 0.5)
minuteHand.rotation = objTime.min * 6
secondHand.rotation = objTime.sec * 6
end

timer.performWithDelay (1000, moveHands, 0)[/lua]

And here’s the debugger output:

Copyright (C) 2009-2010 A n s c a , I n c .  
 Version: 0.4.0  
 Build: 2010.9.2.81  
The file sandbox for this project is located at the following folder:  
 (/Users/MikeAccount/Library/Application Support/Corona Simulator/Corona\_Clock-9893B60112736FA2DF6CABC428DFF4B6)  
Paused at file main.lua  
Type 'help' for commands  
\>   
  

Is there something wrong with the code? Once executed, the simulator freezes completely and the debugger does not say anything helpful. [import]uid: 9644 topic_id: 2334 reply_id: 302334[/import]

I think in this instance you need to type “run” or “c” at the command line to start execution. That’s the way it works in the debugger. [import]uid: 4454 topic_id: 2334 reply_id: 7154[/import]

[edit] I thought it was the iterate parameter being set to 0 causing the problem, but I just tried the code and it works for me. Maybe a problem with your graphic files?

Add a print(“tick”) statement in the moveHands function to see if it’s iterating properly

[edit] OK found it - you have a typo in the hourHand.rotation statement in the moveHands function (obTime instead of objTime)
[import]uid: 9064 topic_id: 2334 reply_id: 7155[/import]

Ahhh… both of you are right! There was a typo in line 24, but I also just learned a very important thing about the Corona debugger: you have to type RUN in order to start the code.

It works now. Thanks for the hints! [import]uid: 9644 topic_id: 2334 reply_id: 7159[/import]