What is the "stringWithContentsOfURL" replacement for objective C?

Posted by Graeme on Stack Overflow See other posts from Stack Overflow or by Graeme
Published on 2010-01-11T00:06:44Z Indexed on 2010/04/26 3:03 UTC
Read the original article Hit count: 632

Filed under:
|
|

I found a tutorial on the net that uses the stringWithContentsOfURL command that is now deprecated as of iPhone OS 3.0. However I can't find out what I'm meant to use instead, and how to implement it.

Below is the code surrounding the stringWithContentsOfURL line in case you need it for reference.

NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv", 
     [addressField.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSString *locationString = [NSString stringWithContentsOfURL:[NSURL URLWithString:urlString]];
NSArray *listItems = [locationString componentsSeparatedByString:@","];

Thanks.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about Development