I need to check whether a URL (represented by a NSURL) is available or returns 404. What is the best way to achieve that?
I would prefer a way to check this without a delegate, if possible. I need to block the program execution until I know if the URL is reachable or not.
As you may know already that general error can capture by didFailWithError method:
but for 404 “Not Found” or 500 “Internal Server Error” should able to capture inside didReceiveResponse method: