title: Fast image stream using objective C
body: <p>I've been working on a project which involves a network connection between a server on a Mac, and a client on an iOS device.
  The client side requires a live view of of the server's screen.</p>
  
  <p>As of now, my solution has been </p>
  
  <ul>
  <li>getting snapshots of the Mac's screen using CGDisplayCreateImage( ). Timing is done with an NSTimer set to fire every 1/30.0 second.</li>
  <li>compressing and generating GIF images using CGImageDestination</li>
  <li>sending the GIF images (which are stored in NSData) over Bonjour to the client.</li>
  <li>client receives the data, and initializes a new UIImage from it, passing it into an image view.</li>
  </ul>
  
  <p>But I've been encountering a few problems with this method.</p>
  
  <ol>
  <li><p>The latency is horrible. Each image took many seconds to load, and seemed to never even reach the client.</p></li>
  <li><p>Each image NSData object's size was around 170000 bytes long. This seems WAY too high to even send over network fast enough. But I have no idea how to compress the images further.</p></li>
  </ol>
  
  <p>Thank you.</p>