Re: Strange retainCount from NSTimer

2008-03-13 Thread Michael Ash
On Thu, Mar 13, 2008 at 9:37 PM, Brian Greenstone <[EMAIL PROTECTED]> wrote: > I'm hoping someone can shed some light on this for me. I'm getting > some unusual retainCount values from the following code: > > NSTimer *theTimer; > > theTimer = [NSTimer scheduledTimerWithTimeInterva

Re: Strange retainCount from NSTimer

2008-03-13 Thread Tom Bunch
I would expect, at "A", for the timer to have any retain count of at least one, and an equal number of releases pending in your autorelease pool. Maybe the run loop's autorelease pool is getting popped or drained as a side effect of adding the timer or something. If you really want to fig

Re: Strange retainCount from NSTimer

2008-03-13 Thread Chris Suter
On 14/03/2008, at 12:37 PM, Brian Greenstone wrote: But that shouldn't be, right? Shouldn't the retainCount of theTimer be 1 after scheduledTimerWithTimeInterval? Then shouldn't it be bumped up to 2 after adding the timer to the Run Loop? It appears that the retain count is starting at

Re: Strange retainCount from NSTimer

2008-03-13 Thread John Stiles
I guess this just proves the age-old rule, "never rely on the return value of -retainCount to make sense." :) Seriously, this does seem weird, but -retainCount seems to have a mind of its own. Just have faith in the memory management rules. Brian Greenstone wrote: I'm hoping someone can shed s

Strange retainCount from NSTimer

2008-03-13 Thread Brian Greenstone
I'm hoping someone can shed some light on this for me. I'm getting some unusual retainCount values from the following code: NSTimer *theTimer; theTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target: