title: NSURLConnection didSendBodyData progress
body: <p>I'm using a POST request to upload some data to a server, and I'm trying to update the UIProgressView's progress based on the <code>totalBytesWritten</code> property of the <code>didSendBodyData</code> method of <code>NSURLConnection</code>. Using the below code, I don't get a proper updating of the progress view, it's always 0.000 until it finishes. I'm not sure what to multiply or divide by to get a better progress of the upload.</p>
  
  <p>I'd appreciate any help offered! Code:</p>
  
  <pre><code>- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
  {
      NSNumber *progress = [NSNumber numberWithFloat:(totalBytesWritten / totalBytesExpectedToWrite)];
  
      NSLog(@"Proggy: %f",progress.floatValue);
  
      self.uploadProgressView.progress = progress.floatValue;
  }
  </code></pre>