title: Convert a NSTimeInterval duration into NSString
body: <p>I am new in iphone development. I have a issue. I want to convert a NSTimeInterval value in NSString, but not success in this. please a quick look on below code.</p>
  
  <p>in .h</p>
  
  <pre><code>NSTimeInterval startTime;
  NSTimeInterval stopTime;
  NSTimeInterval duration;
  </code></pre>
  
  <p>in .m</p>
  
  <pre><code>startTime = [NSDate timeIntervalSinceReferenceDate];
  stopTime = [NSDate timeIntervalSinceReferenceDate];
  
  duration = stopTime-startTime;
  
  NSLog(@"Duration is %@",[NSDate dateWithTimeIntervalSinceReferenceDate: duration]);
  NSLog(@"Duration is %@", [NSString stringWithFormat:@"%f", duration]);
  
  NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
  
  NSString *time = [dateFormatter stringFromDate:duration];----&gt; Error
  [dateFormatter release];
  </code></pre>
  
  <p>And on one label set this string----</p>
  
  <pre><code>[timeLabel setText:time];
  </code></pre>
  
  <p>but it not works it shows  error: incompatible type for argument 1 of 'stringFromDate:'</p>
  
  <p>and if i comment that line it shows the right duration in console window.</p>
  
  <p>thanks for any help.</p>