FROM : Matt Neuburg
DATE : Fri Dec 24 19:18:33 2004
On Thu, 23 Dec 2004 23:31:21 +0000, Peter Browne
<<email_removed>> said:
>If the website is online then the
>dictionary is initialised with the contents of the URL, but if there is
>a change of state and the site goes down after a while (or goes back up
>if it was down to begin with) then the program hangs.
>
> radioCheck = [NSDictionary dictionaryWithContentsOfURL:[NSURL
>URLWithString:@"http://www.noopaala.com/stuff/famcatsInfo.xml"]]; //
>Create the dictionary
dictionaryWithContentsOfURL is a pretty simple-minded way to check a remote
URL, and it's probably synchononous (explainint the hang). I use NSTask and
'curl'; this gives a lot of control, it's asynchronous, and if there's an
error/timeout you get back a useful result. (There are other ways but I find
this particularly easy.) m.
--
matt neuburg, phd = <email_removed>, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
DATE : Fri Dec 24 19:18:33 2004
On Thu, 23 Dec 2004 23:31:21 +0000, Peter Browne
<<email_removed>> said:
>If the website is online then the
>dictionary is initialised with the contents of the URL, but if there is
>a change of state and the site goes down after a while (or goes back up
>if it was down to begin with) then the program hangs.
>
> radioCheck = [NSDictionary dictionaryWithContentsOfURL:[NSURL
>URLWithString:@"http://www.noopaala.com/stuff/famcatsInfo.xml"]]; //
>Create the dictionary
dictionaryWithContentsOfURL is a pretty simple-minded way to check a remote
URL, and it's probably synchononous (explainint the hang). I use NSTask and
'curl'; this gives a lot of control, it's asynchronous, and if there's an
error/timeout you get back a useful result. (There are other ways but I find
this particularly easy.) m.
--
matt neuburg, phd = <email_removed>, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
| Related mails | Author | Date |
|---|---|---|
| Peter Browne | Dec 24, 00:31 | |
| Matt Neuburg | Dec 24, 19:18 |






Cocoa mail archive

