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
You can achieve a synchronous connection by calling:
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
NSHTTPURLResponse* response = nil;
NSError* error = nil;
[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
Your thread will block until the request has beeen made.