timeout stringwithcontentsofurl

Posted by sergiobuj on Stack Overflow See other posts from Stack Overflow or by sergiobuj
Published on 2010-06-12T00:50:17Z Indexed on 2010/06/12 0:52 UTC
Read the original article Hit count: 215

Filed under:
|
|

Hi, I have this call to stringwithcontentsofurl:

[NSString stringWithContentsOfURL:url usedEncoding:NSASCIIStringEncoding  error:nil];

How can I give that a simple timeout? I don't want to use threads or operation queues (the content of the url is about 100 characters), I just don't want to wait too long when the connection is slow.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about nsstring