如何将数据传递给iPhone中的Tbxml

问题描述:

我正在尝试使用TBXML,我想通过发送用户名和密码来解析xml,但是dnt怎么做,我已经通过了很多教程。如何将数据传递给iPhone中的Tbxml

-(IBAction)login{ 
        NSString *str2=emailtxt.text; 
        NSString *str3=passtxt.text; 

        TBXML * tbxml = [TBXML tbxmlWithURL:[NSURL URLWithString:@"http://www.vinipost.com/my_service.asmx/signIn"]]; 


        TBXMLElement *rootXMLElement = tbxml.rootXMLElement; 

        if (rootXMLElement) 
        { 
         TBXMLElement * user = [TBXML childElementNamed:@"Table1" parentElement:rootXMLElement]; 

         while (user != nil) 
         { 

          TBXMLElement *CountryId = [TBXML childElementNamed:@"usrid" parentElement:user]; 
          if (CountryId != nil) 
          { 
           NSLog(@"CountryId :: %@", [TBXML textForElement:CountryId]); 
          } 

          TBXMLElement *CountryName = [TBXML childElementNamed:@"ContctNmbr" parentElement:user]; 
          if (CountryName != nil) 
          { 
           NSLog(@"CountryName :: %@", [TBXML textForElement:CountryName]); 
          } 

          user = [TBXML nextSiblingNamed:@"Table1" searchFromElement:user]; 
         } 
        } 
       } 
+0

什么是输出为您的代码更改您的网址

[NSURL URLWithString:@"http://www.vinipost.com/my_service.asmx/signIn?email=yourEmail&pass=yourPass"]; 

您可以设置在运行时的电子邮件和密码? – Ganapathy 2013-03-06 06:20:48

+0

发布到url并解析url是不同的。 – Exploring 2013-03-06 06:21:58

+0

@sanjitshaw -sorry但是我想通过传递用户名和密码来登录这个URL,但是怎么做 – 2013-03-06 06:23:17

通过以下链接Operation On String