dataWithContentsOfURL
dataWithContentsOfURL
- Subject: dataWithContentsOfURL
- From: Angela Brett <email@hidden>
- Date: Wed, 7 Nov 2001 18:44:20 +1300
Hi,
I'm using NSData's initWithURL: method to download files from the
internet. However, if I disconnect from the internet, the
dataWithContentsOfURL never finishes, so my program can't continue. I
was hoping that if it couldn't finish downloading the data, it would
return nil so I could just keep going and do something about the lack
of data. How can I get the dataWithContentsOfURL to stop if the
connection dies or it can't finish getting the data for some other
reason? I can see there's URL:resourceDidFailLoadingWithReason: in
the NSObject docs, but I don't know if that's what I need to use or
how to use it.
--
Angela Brett email@hidden
http://acronyms.co.nz/angela
"We must believe in free will, we have no choice!" -- Isaac Bashevis Singer