Guest User

Untitled

a guest
Nov 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. 2018-11-18 17:09:19.982104+0000 FetchData[2952:80880]
  2. Fetching Courses
  3. 2018-11-18 17:09:20.008461+0000 FetchData[2952:81017] Task
  4. <31F8B323-CEE4-4D7A-B1D4-BB42632EF8CF>.<1> finished with
  5. error - code: -1002
  6. 2018-11-18 17:09:20.090966+0000 FetchData[2952:81015]
  7. Finished fetching
  8. 2018-11-18 17:09:20.091679+0000 FetchData[2952:81015] Dummy String
  9.  
  10. -(void)fetchCoursesUsingJSON{
  11. NSLog(@"Fetching Courses");
  12. NSString * urlString = @"//https://api.letsbuildthatapp.com/jsondecodable/courses";
  13.  
  14. NSURL *url =[NSURL URLWithString:urlString];
  15.  
  16. [[NSURLSession.sharedSession dataTaskWithURL:url completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
  17. NSLog(@"Finished fetching");
  18.  
  19. NSString *dummyString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  20. NSLog(@"Dummy String %@", dummyString);
  21.  
  22.  
  23. }]resume];
  24.  
  25.  
  26. }
Add Comment
Please, Sign In to add comment