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,
function login()
{
$mainframe = JFactory::getApplication();
$xmlcnt = array();
if (!isset($HTTP_RAW_POST_DATA))
{
$HTTP_RAW_POST_DATA = 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 = $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;
} ......
and the xmldata look like this "<data><username>testuser</username><password>password</password></data>
"
i want to understand how/what should i use in xcode objective-c to send and recieve XML efficiently.
Thank you verymuch