venues now have correct information on them
This commit is contained in:
27
FestivalHelper/common/FESDataProvider.m
Normal file
27
FestivalHelper/common/FESDataProvider.m
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// FESDataProvider.m
|
||||
// FestivalHelper
|
||||
//
|
||||
// Created by Hamo Hapic on 04/09/14.
|
||||
// Copyright (c) 2014 Senad Uka. All rights reserved.
|
||||
//
|
||||
|
||||
#import "FESDataProvider.h"
|
||||
|
||||
@implementation FESDataProvider
|
||||
|
||||
+(void)getDataFromServerForUrl:(NSString *)urlString andProcessThemWith:(void (^)(NSData *data))block {
|
||||
NSLog(@"Getting data from: %@" , urlString);
|
||||
NSURL *url = [[NSURL alloc] initWithString:urlString];
|
||||
[NSURLConnection sendAsynchronousRequest:[[NSURLRequest alloc] initWithURL:url] queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
|
||||
if(connectionError) {
|
||||
NSLog(@"Error getting %@ data from url: - %@", urlString, [connectionError localizedDescription]);
|
||||
}
|
||||
else {
|
||||
NSLog(@"Parsing data.");
|
||||
block(data);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user