Re: How do I cancel a NSURL loadResourceDataNotifyingClient:usingCache: ?
Re: How do I cancel a NSURL loadResourceDataNotifyingClient:usingCache: ?
- Subject: Re: How do I cancel a NSURL loadResourceDataNotifyingClient:usingCache: ?
- From: Finlay Dobbie <email@hidden>
- Date: Sat, 2 Mar 2002 22:04:10 +0000
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
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.