Extract Data from NSURLConnection return data

Discussion in 'iPhone/iPad Programming' started by CocoaPuffs, Apr 25, 2009.

  1. macrumors 68010

    Joined:
    Aug 23, 2008
    #1
    Quick question, is substringWithRange the best way to extract specific data from raw data return from NSURLConnection?
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    NSURLConnection gives you an NSData object, so you'd have to convert your data to an NSString first to use that method (and you'd have to know the encoding). Once you have a string though, extracting bits of information from it depend entirely on the format, so substringWithRange would not always be the best. What if it was XML, tab-delimited, etc.?
     
  3. thread starter macrumors 68010

    Joined:
    Aug 23, 2008
    #3
    Sorry I wasn't being more specific. I was trying to extract the authorization token from Google, and thought maybe there might be a better approach.
     

Share This Page