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

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


  • Subject: NSURLRequest or alternative & structuring data for use with NSBrowser? (Total Noob questions...)
  • From: Cliff Pruitt <email@hidden>
  • Date: Fri, 4 May 2007 11:23:09 -0400

Hi everyone,
I've sort of been trying to learn Cocoa on & off for a couple of years now & after many re-starts its just now kind of starting to make sense this time around. That said, I've hit a block in terms of knowing where to go with some things.


I'm working on a little app for personal use that just has the following requirements:

1.
Use an HTTP GET or POST to request a document from a website.
I'll need to pass a few parameters like a record ID to allow the server to do the lookup & generate the file.
That document will be formatted in whatever way is easiest to process with Cocoa after I get it (XML?).
The document will represent a hierarchy of data, roughly equivalent to a virtual file system with unlimited files & folders etc...


2.
That document will be parsed or otherwise used to populate an NS Browser view.
I'm basically trying to re-create a VERY simple finder column view to allow me to access records within a custom web service.
Selecting a virtual "folder" displays sub-items. Selecting a "file" leaf displays record info.



** As a side note, I don't want to get into the whole SOAP type web services thing because I don't really want to deal with creating the web service on the server at this point. I'd rather just make it a straightforward HTTP Post.



So far I have my UI set up & connected and I have the browser view populating columns with fake data from its delegate (just enough to get columns/cells to respond when clicked). Next I need to just worry about getting the file from the web. So this is where I get stuck.


I have these unknowns I'm hoping someone can help answer:

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.

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?

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.

Anyway, if anyone can offer some advice I'd really appreciate it. I do try to get as far as I can on my own before bugging a list with noob questions.

Thanks a lot,
Cliff

_______________________________________________

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


  • Follow-Ups:
    • Re: NSURLRequest or alternative & structuring data for use with NSBrowser? (Total Noob questions...)
      • From: Brian Smith <email@hidden>
  • Prev by Date: Adding an event handler to an NSView subclass using categories
  • Next by Date: Re: post hidden mouse events
  • Previous by thread: Re: Adding an event handler to an NSView subclass using categories
  • Next by thread: Re: NSURLRequest or alternative & structuring data for use with NSBrowser? (Total Noob questions...)
  • Index(es):
    • Date
    • Thread