PDA

View Full Version : Programing help NEEDED!




alexskiing
Nov 18, 2007, 08:58 PM
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
Nov 18, 2007, 10:28 PM
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
Nov 18, 2007, 10:40 PM
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
Nov 18, 2007, 11:05 PM
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
Nov 19, 2007, 04:25 PM
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
Nov 19, 2007, 05:54 PM
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/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html

When in doubt, look at Apple's docs. They are pretty complete, and usually include decent sample code.