• 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
Cocoa Equivalent to BufferedStreamReader?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cocoa Equivalent to BufferedStreamReader?


  • Subject: Cocoa Equivalent to BufferedStreamReader?
  • From: Jeff LaMarche <email@hidden>
  • Date: Tue, 6 Nov 2001 19:39:39 -0800

Right now I've got a very thread that simply loads an NSData from an internet URL, like so:

thumbData = [NSData dataWithContentsOfURL:thumbURL];
[thumbData retain];

It works fine, but it's limited - I can't provide any feedback concerning how much has been downloaded, nor can I kill the thread. I read through the NSURL and NSURLHandle docs, and while I see some alternative mechanisms of doing the same thing, they all seem to leave all the work to Cocoa classes. NSURLHandle has a mechanism for killing a load that's being done in the background but that's still not as much control as I'd like.

Is there anything that allows you to read the data from a URL line-by-line or byte-by-byte in a loop so that you can provide some feedback about the progress and offer a way to cancel the load? In Java, IIRC, you can load data from a URL using a BufferedStreamReader or IOReader or one of the various reader classes (don't remember which one, that's what JavaDoc is for =) ), which allows you to stop loading after the current chunk.

Any suggestions or help is, as always, appreciated.

Jeff


  • Follow-Ups:
    • Re: Cocoa Equivalent to BufferedStreamReader?
      • From: Dan Wood <email@hidden>
  • Prev by Date: Re: Info window scenario
  • Next by Date: [Q] Keyboard Event
  • Previous by thread: [ANN] Think Factory 1.0 for OSX developers
  • Next by thread: Re: Cocoa Equivalent to BufferedStreamReader?
  • Index(es):
    • Date
    • Thread