Hello Master Mind Friends I have One issue i am showing information of web site using web view. Before showing it i want to know is it url link active or not if it is then i will show it in webView otherwise i will show alert message to User. Can anyone help to me. The url is like www.domainname.com:8150/imagename.jpg will it work or not. In this i want to know Will this link active or not. Thanks in advance.
A:
- Check whether your internet connection is alive with well known host. For example you can use the following request:
NSMutableURLRequest req = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://www.google.com"]];
NSHTTPURLResponse urlResponse = nil;
NSError *error = [[[NSError alloc] init] autorelease];
NSData *data = [NSURLConnection sendSynchronousRequest:req returningResponse:&urlResponse error:&error];
[req release];
- Then do the same for your url.
Valentyn
2010-05-03 14:11:24