I am trying to return the contents of my NSURL request as an integer/numerical value rather than an NSString. I have had quite a bit of trouble with this. Does anyone know what the last line of code needs to be to do this? Thank you!
NSString *distanceURL = [NSString stringWithFormat:@"http://www.website.com/distance.php?lat1=%@&lon1=%@&lat2=%@&lon2=%@",userLatitude, userLongitude, placeLatitude, placeLongitude];
NSData *distanceURLResult = [NSData dataWithContentsOfURL:[NSURL
URLWithString:distanceURL]];
int distanceInFeet = distanceURLResult;
Try:
Check for the correct encoding of the returned data.