//JsonToDictionary method
-(NSMutableDictionary *)JsontoDictionary:(NSString*)jsonString {
jsonData = [jsonString dataUsingEncoding:NSUTF32BigEndianStringEncoding];
jsonDeserializer = [CJSONDeserializer deserializer]; // Third party JSON serialization
NSError *error =nil;
NSMutableDictionary *resultsDictionarytemp = [jsonDeserializer deserializeAsDictionary:jsonData error:&error];
if (error != nil) {
UIAlertView *errorAlertView = [[UIAlertView alloc] initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[errorAlertView show];
}
return resultsDictionarytemp;
}
//Invoke method
NSMutableDictionary *json = [self JsontoDictionary:strFileContent];
No comments:
Post a Comment