Re: Using NSURL
Re: Using NSURL
- Subject: Re: Using NSURL
- From: "Michael P. Rogers" <email@hidden>
- Date: Thu, 21 Mar 2002 14:38:15 -0600
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?
Here's a snippet of code that might help:
-(IBAction)downloadStuff:(id)sender {
NSString * urlSTR = @"
http://www.apple.com/idisk/etcetc/myfile.txt";
NSURL * earl = [NSURL URLWithString:urlSTR];
NSData * theData = [earl resourceDataUsingCache:NO];
NSSString * theText = [[NSString alloc]initWith
Data:theData
encoding:nil];
[self processText:theText];
}
Michael
--
Dr. Michael P. Rogers
Office: 203G Shilling Hall
Phone: 217-424-6327 (W) 309-828-8655 (H) 309-825-6454 (C)
E-Mail: email@hidden
Web site:
http://math.millikin.edu/
Astronomy Site:
http://twincityamateurastronomers.org
_______________________________________________
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>) |