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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -