PDA

View Full Version : Equivalent function in Objective C




magga
Oct 13, 2009, 10:43 AM
Hi guys,

I have just started trying to make my own iPhone app after following some examples online and in books.

What I am trying to do is connect to an external API that returns XML. I am then trying to display certain values from the returned XML on screen.

The example I have for connecting to this API uses the curl function in php and sends various variables such as username, password and action.

The question is, how can I replicate this functionality in Objective C?

I've tried Googling this but haven't been very successful.

Any pointers in the right direction would be appreciated.

Thanks



robbieduncan
Oct 13, 2009, 10:45 AM
I'd look at using NSURLConnection (http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html).

magga
Oct 13, 2009, 12:14 PM
Thanks for that, I took a look but it went a bit over my head to be honest.

I think I need to go over a load of the basics again!

g3funk
Oct 14, 2009, 09:59 AM
I'd look at using NSURLConnection (http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html).

Yeah, this is exactly how I do it as well. In addition, I only get to really build apps on the weekends so I am constantly going back to the basics with the oddest things I run into. It is always worth it, especially if you are new to C to always be going back to basics to improve / make life easier.