How to abort iPhone's NSXMLParser wait

Posted by Wayne Lo on Stack Overflow See other posts from Stack Overflow or by Wayne Lo
Published on 2010-05-13T20:24:52Z Indexed on 2010/05/13 21:44 UTC
Read the original article Hit count: 226

Filed under:
|
|

When init the NSXLParser as below:

NSXMLParser* xmlParser=[[NSXMLParser alloc] initWithContentsOfURL:[NSURL URLWithString:urlstring]];

if the server is down, it will wait for quite some time before the thread returns. It is really annoying even if I exit the application and restart the application, it will continue to wait with a black screen until it times out.

How to I abort the init? Is there a better way to check whether the server is up before calling the parser? Thanks for helping.

© Stack Overflow or respective owner

Related posts about nsxmlparser

Related posts about wait