NSString *final_url = [NSString stringWithFormat:url]; final_url = [final_url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:final_url] cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:120.0]; NSURLResponse *response; NSError *error = [[NSError alloc] init]; NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; NSString *strResponse = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; SBJSON *objJSON = [SBJSON new]; NSMutableDictionary *objDataDic = [objJSON objectWithString:strResponse error:nil];
source share