Re: Using NSURL
Re: Using NSURL
- Subject: Re: Using NSURL
- From: John Blackburn <email@hidden>
- Date: Thu, 21 Mar 2002 12:14:47 -0800
You're better off using NSURLHandle to load the data in the background.
When the data's done loading, your URLHandleResourceDidFinishLoading:
gets called with the file's data:
- (void)initiateLoad:(NSString*)urlString
{
NSURLHandle* handle = [[NSURL URLWithString:urlString]
URLHandleUsingCache:YES];
[handle addClient:self]; // add self, so your
URLHandleResourceDidFinishLoading: will get called
[handle loadInBackground];
}
- (void)URLHandleResourceDidFinishLoading:(NSURLHandle *)sender
{
NSData* fileData = [sender resourceData];
// do something with the data
}
John Blackburn
On Thursday, March 21, 2002, at 07:41 PM, David Ahmed wrote:
Hi!
I'm trying to download a small text file from the internet (actually
it's in
my idisk 'sites' folder) into an object so that the application can
update
certain variables. Can anyone show me an example of NSURL in action or
suggest a suitable approach?
Many thanks!
David
_______________________________________________
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.
_______________________________________________
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.
References: | |
| >Using NSURL (From: David Ahmed <email@hidden>) |