title: Find difference between two timestamps - iOS
body: <p>I am trying to use NSTimeInterval to figure out the difference between two timestamps in my iOS application. However I when trying to pass in my timestamp, I get the following error:</p>
  
  <blockquote>
    <p>Bad receiver type 'double'</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>// Get the current date/time in timestamp format.
  NSString *timestamp = [NSString stringWithFormat:@"%f", [[NSDate new] timeIntervalSince1970]];
  double current = [timestamp doubleValue];
  
  // Find difference between current timestamp and
  // the timestamp returned in the JSON file.
  NSTimeInterval difference = [current timeIntervalSinceDate:1296748524];
  </code></pre>
  
  <p>I thought that NSTimeInterval is just a another meaning for double.. is it not?</p>
  
  <p>Note that '1296748524' is just being used here as a test.</p>
  
  <p>I don't understand what I am doing wrong.</p>
  
  <p>Thanks for you're time :)</p>