[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How do I cancel a NSURL loadResourceDataNotifyingClient:usingCache: ?
- Subject: How do I cancel a NSURL loadResourceDataNotifyingClient:usingCache: ?
- From: finlay.dobbie at btinternet.com (Finlay Dobbie)
- Date: Sat Mar 2 14:06:00 2002
- In-reply-to: <3F8FC62E-2E27-11D6-B1CE-0003930AD8A4@rna.nl>
On Saturday, March 2, 2002, at 09:48 PM, Gerben Wierda wrote:
> [[_downloadingURL URLHandleUsingCache:YES] cancelLoadInBackground];
When you begin downloading, store a reference to the NSURLHandle. Call
beginLoadInBackground on your URLHandle. Later on, call
cancelLoadInBackground on your URLHandle. What you are doing here is
creating a new NSURLHandle for that URL, and telling it to cancel
loading -- this does nothing as it isn't even loading in the first
place! :-)
So instead of doing [aURL loadResourceDataNotifyingClient:usingCache:],
do
NSURLHandle *aURLHandle = [aURL URLHandleUsingCache:YES];
[aURLHandle addClient:self];
[aURLHandle beginLoadInBackground];
...
[aURLHandle cancelLoadInBackground];
All conceptual code, might not compile :-)
-- Finlay