0

i am creating cells with width and height of UIImage.
i am getting the images from Facebook post OR twitter Feed.

Currently i just can set the cells size AFTER downloading the image and this leads to delaying.

So my question is: is it possible to get the image headers WITHOUT downloading the image itself with folling Frameworks/SDKs:

  • SLRequest
  • Facebook SDK
  • Twitter Api

i only need the header informations of the images for layouting my UI.
Any recommendations or experiences about that?

Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
brush51
  • 5,691
  • 6
  • 39
  • 73

1 Answers1

0

If you know that the information you want is returned in the header then you could try:

  1. Get an NSURLRequest request with preparedURLRequest
  2. Make a mutableCopy of it
  3. Call setHTTPMethod: with @"HEAD" to specify you only want headers

Note that if the server doesn't support HEAD requests then the image data would generally be returned anyway (usually instead of an error)...

Wain
  • 118,658
  • 15
  • 128
  • 151
  • but this will also force a download(which make everything slower) before getting the header infos, or not? – brush51 Aug 08 '14 at 13:36