NSString *converEnvoi =[nEnvoi stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *result = [NSString stringWithContentsOfURL:[NSURL URLWithString:converEnvoi] encoding:NSUTF8StringEncoding error:NULL]; NSString *new = [result stringByReplacingOccurrencesOfString: @"[" withString:@""]; result = [new stringByReplacingOccurrencesOfString: @"]" withString:@""]; if (result) { NSLog(@"LOC RESULT: %@", result); NSDictionary *resultDict = [NSJSONSerialization JSONObjectWithData: [result dataUsingEncoding:NSUTF8StringEncoding] options: NSJSONReadingMutableContainers error: &error]; NSArray *resultsArray = [resultDict objectForKey:@"iddep"]; if(resultsArray.count > 0) { } }
RESULT: {"iduti":"142","iddep":"25"}
Bug : NSArray *resultsArray = [resultDict objectForKey:@"iddep"];
Merci d'avance
NSString *converEnvoi =[nEnvoi stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
RESULT: {"iduti":"142","iddep":"25"}
Bug : NSArray *resultsArray = [resultDict objectForKey:@"iddep"];
Merci d'avance