2
我正在嘗試使用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];
}
}
}
什麼是輸出爲您的代碼更改您的網址
您可以設置在運行時的電子郵件和密碼? – Ganapathy 2013-03-06 06:20:48
發佈到url並解析url是不同的。 – Exploring 2013-03-06 06:21:58
@sanjitshaw -sorry但是我想通過傳遞用戶名和密碼來登錄這個URL,但是怎麼做 – 2013-03-06 06:23:17