iOS app using PHP XML based web API

ipollesion

New Member
I am fairly new to iOS development and trying make a simple app which will communicate with PHP API. Data request and response will be in XML format only.. this is my php method for login,\[code\]function login(){ $mainframe = JFactory::getApplication(); $xmlcnt = array(); if (!isset($HTTP_RAW_POST_DATA)) { $HTTP_RAW_POST_DATA = http://stackoverflow.com/questions/11236934/file_get_contents("php://input"); } if(empty($HTTP_RAW_POST_DATA)) { $xmlcnt['code'] = "2"; return $xmlcnt; } $doc = new DOMDocument(); $doc->loadXML( $HTTP_RAW_POST_DATA); $login_data = http://stackoverflow.com/questions/11236934/$doc->getElementsByTagName("data" ); foreach( $login_data as $login ) { $user_nm = $login->getElementsByTagName( "username" ); $user_nm = $user_nm->item(0)->nodeValue; $password = $login->getElementsByTagName( "password" ); $password = $password->item(0)->nodeValue; } ......\[/code\]and the xmldata look like this "\[code\]<data><username>testuser</username><password>password</password></data>\[/code\]"i want to understand how/what should i use in xcode objective-c to send and recieve XML efficiently. Thank you verymuch
 
Back
Top