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

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 s

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 scheduledTimerWithTi

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 y

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

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 nu

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

2008-06-27 Thread Stephen J. Butler
On Fri, Jun 27, 2008 at 10:55 PM, Daniel Richman <[EMAIL PROTECTED]> wrote: > What's happening is that if I enter a number and then press 'start', 'start' > stays in the 'pressed' position until the loop finishes, after which it > returns to the normal position. My guess is that this is stopping an

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