Thursday, August 25, 2011

performSelector: withObject: afterDelay: issue

I have discovered interesting issue today. I have the method for updating some info:
- (void) updateObject {
  // updating code

  // schedule next updating
  [self performSelector:@selector(updateObject) withObject:nil afterDelay:4.0];
  NSLog(@"done");
}
I figured out that updateObject is called twice! Second call was made immediately after first call was finished.