Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSURLRequest *request;
- NSURLResponse *response = nil;
- NSError **error=nil;
- NSData *data=[[NSData alloc] initWithData:[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:error]];
- NSString* retVal = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- // you can use retVal , ignore if you don't need.
- NSInteger httpStatus = [((NSHTTPURLResponse *)response) statusCode];
- NSLog(@"responsecode:%d", httpStatus);
- // there will be various HTTP response code (status)
- // you might concern with 404
- if(httpStatus == 404)
- {
- // do your job
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement