I've watched this, but didn't found a solution.
I have a timer
self.checklinkTimer = [NSTimer scheduledTimerWithTimeInterval:5
target:self
selector:@selector(doWithHandler:)
userInfo:nil
repeats:YES];
and method
-(void) doWithHandler:(void (^)(BOOL isValid))handler
{
handler(isSessionValid);
}
and other method where i use boolean value from doWithHandler
method.
In doWithHandler
i need to check if handler is NSTimer class and in that case, not do handler(isSessionValid)
.
I tried if ( ! [(id)handler isKindOfClass:[NSTimer class]] )
or @try @catch
but this don't work this way.
Question: how can i check block class?