Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2018-11-18 17:09:19.982104+0000 FetchData[2952:80880]
- Fetching Courses
- 2018-11-18 17:09:20.008461+0000 FetchData[2952:81017] Task
- <31F8B323-CEE4-4D7A-B1D4-BB42632EF8CF>.<1> finished with
- error - code: -1002
- 2018-11-18 17:09:20.090966+0000 FetchData[2952:81015]
- Finished fetching
- 2018-11-18 17:09:20.091679+0000 FetchData[2952:81015] Dummy String
- -(void)fetchCoursesUsingJSON{
- NSLog(@"Fetching Courses");
- NSString * urlString = @"//https://api.letsbuildthatapp.com/jsondecodable/courses";
- NSURL *url =[NSURL URLWithString:urlString];
- [[NSURLSession.sharedSession dataTaskWithURL:url completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
- NSLog(@"Finished fetching");
- NSString *dummyString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- NSLog(@"Dummy String %@", dummyString);
- }]resume];
- }
Add Comment
Please, Sign In to add comment