Joined January 2015
·
jht

Jean-François HECQUET

Angers Area, France
·

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

Achievements
1 Karma
0 Total ProTip Views