• 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: NSURLRequest or alternative & structuring data for use with NSBrowser? (Total Noob questions...)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLRequest or alternative & structuring data for use with NSBrowser? (Total Noob questions...)


  • Subject: Re: NSURLRequest or alternative & structuring data for use with NSBrowser? (Total Noob questions...)
  • From: Brian Smith <email@hidden>
  • Date: Fri, 4 May 2007 10:57:42 -0600

Hi Cliff,

On May 4, 2007, at 9:23 AM, Cliff Pruitt wrote:


1. What object is best to use for a single HTTP request? I've looked at NSURLRequest, NSURLConnection, NSURLDownload, etc... and I've read through the "URL Loading System" docs. I sort of get parts of it, but it doesn't seem clear about how all the pieces fit together and what each piece is intended to specifically do.

You are probably best of using the initializer for NSString or NSData that will populate themselfs with the contents from a URL, then you get an object loaded with the content for parsing. I would suggest NSString's - (id)initWithContentsOfURL:usedEncoding:error: method if your not concerned with Mac OS X versions. You can use NSScanner to parse it. Also, look at Web Kit to see if something would work for you.


2. Is it best to download the text to memory and load it into another object, or DL to a temp directory and then read the file back in with something, say to parse XML?

The above sort of answers this. There is a class NSXMLParser for parsing XML.

3. WHat is the best way to model hierarchical data for use with NSBrowser? Is there an accepted "best way" of doing it? Dumping everything into an array containing arrays within arrays seems... convoluted at best.

A tree structure. The "best way" is something somebody else can answer and I think it depends on you data. Arrays of arrays are basically a tree structures. NSDictionary is basically implemented using trees, so it usually a good choice for a container for NSBrowser.


I hope this helps.

Brian
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSURLRequest or alternative & structuring data for use with NSBrowser? (Total Noob questions...) (From: Cliff Pruitt <email@hidden>)

  • Prev by Date: Re: best way to compare selectors?
  • Next by Date: Re: Two simple questions regarding Core-Data
  • Previous by thread: NSURLRequest or alternative & structuring data for use with NSBrowser? (Total Noob questions...)
  • Next by thread: Re: NSURLRequest or alternative & structuring data for use with NSBrowser? (Total Noob questions...)
  • Index(es):
    • Date
    • Thread