- (void)fetchDataSynchronouslyFromURL:(NSString*)urlStr
{
NSString* serverUrl = urlStr;
NSData *serverData = [NSData dataWithContentsOfURL:[NSURL URLWithString:serverUrl]];
NSError* error = nil;
id serverResponse = [NSJSONSerialization JSONObjectWithData:serverData options:kNilOptions error:&error];
NSLog(@"Server response:%@",serverResponse);
}
No comments:
Post a Comment