When you try to access a web service, it will sometimes respond with an authentication challenge, which means Who the heck are you? You then need to send a username and password (a credential) before the server will send its genuine response.

When the challenge is received, the NSURLSession delegate is asked to authenticate that challenge, and the delegate will respond by supplying a username and password.

Open BNRCoursesViewController.m and update fetchFeed to hit a secure Big Nerd Ranch courses web service. (Do not forget to use https instead of http.)

-​ ​(​v​o​i​d​)​f​e​t​c​h​F​e​e​d​
 ​ ​ ​ ​N​S​S​t​r​i​n​g​ ​*​r​e​q​u​e​s​t​S​t​r​i​n​g​ ​=​ ​@​"​h​t​t​p​:​/​/​b​o​o​k​a​p​i​.​b​i​g​n​e​r​d​r​a​n​c​h​.​c​o​m​/​c​o​u​r​s​e​s​.​j​s​o​n​"​;​ ...

Get iOS Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.