Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

alexskiing

macrumors newbie
Original poster
Oct 2, 2007
19
0
Hi, I am working on a big project, I have gotten all of my project done except for this one. I am trying to make an app that will be able to review and download objects directly into the program, much like shapeshifter. I would want to be able to have xml or any other file, then have my app read it and display all of the objects, and people can go next and prev to view objects. I have seen this in many programs, so im wondering if anyone knows of an API, or have some sort of idea getting this started. I very much apreacate any help, THANKS!
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
Hi, I am working on a big project, I have gotten all of my project done except for this one. I am trying to make an app that will be able to review and download objects directly into the program, much like shapeshifter. I would want to be able to have xml or any other file, then have my app read it and display all of the objects, and people can go next and prev to view objects. I have seen this in many programs, so im wondering if anyone knows of an API, or have some sort of idea getting this started. I very much apreacate any help, THANKS!

This is a pretty big thing to get done. However, depending on the reason for this project, there is a shortcut:

Focus on just the parts of CoreFoundation or Cocoa (however you are doing it) that revolve around HTTP connections and getting data that way. Doing it this way will save you a lot of trouble, as you can use any web server to host the files, and leverage the existing code Apple uses to make HTTP requests.
 

alexskiing

macrumors newbie
Original poster
Oct 2, 2007
19
0
Ok...

Thanks for the Tip, Anything helps, Im still looking if anyone knows of an API, or would be willing to help me with my project. THANKS
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
There's no API for this type of thing. It's pretty simple actually. I'm assuming you're going to use Cocoa, so first you'd need to download your XML file - NSURLConnection. Then you'll want to read your XML file - NSXMLDocument. Then the rest is up to you. You will create objects in your program from the XML, and display the objects and properties of the objects. This should be easy once you have the MVC setup.
 

alexskiing

macrumors newbie
Original poster
Oct 2, 2007
19
0
Ok

OK, thanks very much, i have now played around with that, and i got it to kinda work. If anyone has done something like this, could you point me in the right direction? like example code or something please?
Thanks
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
OK, thanks very much, i have now played around with that, and i got it to kinda work. If anyone has done something like this, could you point me in the right direction? like example code or something please?
Thanks

I am currently doing some client/server code myself, but your needs are a fair amount different from mine.

Really, all you need to do is look at the documentation for NSURLConnection. http://developer.apple.com/document...LoadingSystem/Tasks/UsingNSURLConnection.html

When in doubt, look at Apple's docs. They are pretty complete, and usually include decent sample code.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.