Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimer



On 8/31/05, Christopher Hickman <email@hidden> wrote:
[...]
>         incrementerTimer = [NSTimer scheduledTimerWithTimeInterval:seconds
>                                                                 invocation:incrementerInvocation
>                                                                 repeats:YES];
> 
[...]
>         [NSTimer scheduledTimerWithTimeInterval:(seconds*iterations)
>                          invocation:[NSInvocation invocationWithMethodSignature:
>                                                         [incrementerTimer
> methodSignatureForSelector:@selector(invalidate)]]
>                          repeats:NO];

These NSTimers are autoreleased, and are likely getting deallocated
before they can do anything.  You should retain them, keep a reference
to them, and then release them once you're done with them.

-- 
Tom Harrington
email@hidden
AIM: atomicbird1
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >NSTimer (From: Christopher Hickman <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.