Saturday 15 January 2011

objective c - Xcode Call Web PHP File with parameters? -


I'm working on my iOS app on networking. I need to call a php file on my website and then get back the information. I am using this tutorial but now it is old and is now unsupported

  http://www.raywenderlich.com/2965/how-to-write-an-ios-app -that-uses-a-web-service   

I'm looking at MKNetwork Kit for something and I think what I need to use it, but I'm not sure How to implement it.

I think most people agree that it is the most suitable library for it. It's also really good on how to use it. For example, I want to do this with the parameters in the UIWebView (makemyday.com/web/export.php?id=345) Use this to get the contents of the link:

  - (IBAction) SearchFinishBy press button: (ID) Sender {NS URL * baseURL = [NS URL URLWithString: @ "http : //makemyday.com "]; NSDictionary * parameter = @ {@ "ID": @ "345"}; FHTPP Client * Client = [[FTP Client Eloc] Init With Bases: Base URL]; [Client Register HTTP Operation Class: [PHTPRQuest Operation Class]]; [Customer getPath: @ "/ web / export .php" parameter: parameters success: ^ (fttttequest operation * operation, id response object) {nslog (@ "reaction =% @", [operation. Defense subheaderfield]); [Self.webView loadData: responseObject MIMEType: operation.response.MIMEType textEncodingName: operation.response.textEncodingName Support URL: operation.response.URL]; } Failure: ^ (FHTPPKAESTA Operation * Operation, NSERR * Error) {NSLog (@ "Error =% @", error description); }]; }    

No comments:

Post a Comment