Re: while loop with sleep(): logging works, but not UI events

2008-06-28 Thread Michael Ash
On Sat, Jun 28, 2008 at 12:10 AM, Shawn Erickson [EMAIL PROTECTED] wrote: Also you should fire your timer every 0.75 of seconds (or so) to ensure your UI update is consistent/smooth. Firing every second may cause your timer to fire a little after 1 second later so your UI could skip from say

Re: while loop with sleep(): logging works, but not UI events

2008-06-28 Thread Shawn Erickson
On Sat, Jun 28, 2008 at 7:58 AM, Michael Ash [EMAIL PROTECTED] wrote: On Sat, Jun 28, 2008 at 12:10 AM, Shawn Erickson [EMAIL PROTECTED] wrote: Also you should fire your timer every 0.75 of seconds (or so) to ensure your UI update is consistent/smooth. Firing every second may cause your timer

Re: while loop with sleep(): logging works, but not UI events

2008-06-28 Thread Daniel Richman
Thanks very much for this detailed explanation. I realize my mistake now; I was thinking about this in the wrong way. I eventually coded it as follows: - (IBAction)startTimer:(id)sender { timeInSeconds = [((NSNumber *)[inTextField objectValue]) intValue]; [NSTimer

Re: while loop with sleep(): logging works, but not UI events

2008-06-28 Thread Daniel Richman
One second seems to be accurate enough for my purposes, but I'll investigate using 0.5 seconds. Daniel Shawn Erickson wrote: On Sat, Jun 28, 2008 at 7:58 AM, Michael Ash [EMAIL PROTECTED] wrote: On Sat, Jun 28, 2008 at 12:10 AM, Shawn Erickson [EMAIL PROTECTED] wrote: Also you

Re: while loop with sleep(): logging works, but not UI events

2008-06-28 Thread Shawn Erickson
On Sat, Jun 28, 2008 at 8:29 AM, Shawn Erickson [EMAIL PROTECTED] wrote: On Sat, Jun 28, 2008 at 8:13 AM, Daniel Richman [EMAIL PROTECTED] wrote: Thanks very much for this detailed explanation. I realize my mistake now; I was thinking about this in the wrong way. I eventually coded it as

while loop with sleep(): logging works, but not UI events

2008-06-27 Thread Daniel Richman
Hi All, I'm trying to program a simple timer app: you enter a number of seconds, and it updates a text field every second with the number of secs remaining. The problem is that I'm not able to do anything with the UI while this is going on. Here's my code: - (IBAction)startTimer:(id)sender

Re: while loop with sleep(): logging works, but not UI events

2008-06-27 Thread Shawn Erickson
On Fri, Jun 27, 2008 at 8:55 PM, Daniel Richman [EMAIL PROTECTED] wrote: Hi All, I'm trying to program a simple timer app: you enter a number of seconds, and it updates a text field every second with the number of secs remaining. The problem is that I'm not able to do anything with the UI

Re: while loop with sleep(): logging works, but not UI events

2008-06-27 Thread Shawn Erickson
On Fri, Jun 27, 2008 at 8:59 PM, Shawn Erickson [EMAIL PROTECTED] wrote: On Fri, Jun 27, 2008 at 8:55 PM, Daniel Richman [EMAIL PROTECTED] wrote: Hi All, I'm trying to program a simple timer app: you enter a number of seconds, and it updates a text field every second with the number of secs