title: Objective C: constantly calling a function
body: <p>I'm trying to make a pretty simple game and I'm stuck. Basically I want to make a UIImageView appear every 2 seconds. My problem is I can't keep track of cumulative time. Right now I have this:</p>
  
  <pre><code>NSDate *date = [NSDate date];
  
  NSTimeInterval secondsSinceNow = [date timeIntervalSinceNow];
  
  NSLog(@"date = %@", date);
  NSLog(@"secondsSinceNow = %f", secondsSinceNow);
  </code></pre>
  
  <p>It's in my button function so its called when the user taps the button. It returns a decimal number always less than 1. I've tried it in the viewDidLoad method as well as it's own method but neither work.</p>
  
  <p>I think it would work if its in it's own method that is check constantly, but I don't know how to do that. </p>
  
  <p>In short, I need a timer/counter that updates every second. </p>