Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

CocoaPuffs

macrumors 68020
Original poster
Aug 23, 2008
2,005
3
Quick question, is substringWithRange the best way to extract specific data from raw data return from NSURLConnection?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
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.?
 

CocoaPuffs

macrumors 68020
Original poster
Aug 23, 2008
2,005
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.