I have a problem regarding NSTimer
. See the following code:
NSTimeInterval timeInterval = 1.0f;
SEL selector = @selector(executeDataRefresh);
NSMethodSignature *methodSignature = [[ExecuteDataRefesh class] instanceMethodSignatureForSelector:selector];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSignature];
[invocation setTarget:executeDataRefresh];
[invocation setSelector:selector];
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval: timeInterval invocation:invocation repeats:YES];
The object executeDataRefresh
's retain count will now increase by 1 each invocation of method executeDataRefresh
. So after 1 minute the retain count is 60.
I know the method retainCount
shouldn't be used, but is this method really this "incorrect"?
How come?