I have a registration view controller which handles all the user input and calls a function in another class (wsClass) passing to it, that data as an NSDictionary.
T
Try this . This will work well.
-(void)loadDetails
{
NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
[[session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
_allVehicleLocationsArray = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
[self afterCompleteDoThis];
}] resume];
}
-(void)afterCompleteDoThis{
for (NSDictionary *vehicleDict in _allVehicleLocationsArray) {
NSLog(@" PPP %@" , [vehicleDict valueForKey:@"vehicleType"]);
}
}