I want the display the output of a URl using NSLog.
ViewController.h
@interface ViewController : UIViewController{
NSURLSession *session;
NSString *londonWeatherUrl;
NSURLRequest *request;
}
ViewController.m
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
londonWeatherUrl = @"http://api.openweathermap.org/data/2.5/weather?q=London,uk&appid=2de143494c0b295cca9337e1e96b00e0";
request = [NSURLRequest requestWithURL:
[NSURL URLWithString:londonWeatherUrl]];
[[session dataTaskWithURL:[NSURL URLWithString:londonWeatherUrl]
completionHandler:^(NSData *data,
NSURLResponse *response,
NSError *error) {}] resume];
session = [NSURLSession sharedSession];
NSLog(@"%@",); // what goes here ?
}
Can someone tell me what do i need to have inside NSLog so that the output of that URL is displayed in the log. Sorry, i am a beginner in objective C.