xcode - Check web server is up or down in iphone -
i need little here!!!
if string 'url' contains address web server, how check whether web server or down? got codes check internet connectivity. if have internet connectivity how know server or not? there better way that?
thank you
you request,
nsurlrequest *therequest=[nsurlrequest requestwithurl:[nsurl urlwithstring:url] cachepolicy:nsurlrequestuseprotocolcachepolicy timeoutinterval:20.0]; nsurlconnection *theconnection=[[nsurlconnection alloc] initwithrequest:therequest delegate:self];
now if implement (along other delegate methods)
-(void)connectiondidfinishloading:(nsurlconnection *)connection -(void)connection:(nsurlconnection *)connection didfailwitherror:(nserror *)error
you either succes or error.
Comments
Post a Comment