• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using NSURL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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]initWithData: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>)

  • Prev by Date: Re: mouseMoved problems [SOLVED]
  • Next by Date: Re: Using NSURL
  • Previous by thread: Using NSURL
  • Next by thread: Re: Using NSURL
  • Index(es):
    • Date
    • Thread