我有一個靜態數組like.Here它是靜態數組。我想從Web服務加載。 如如何從Web服務加載數組?
- (void)viewDidLoad
{
[super viewDidLoad];
tableData = [NSArray arrayWithObjects:@"Egg Benedict", @"Mushroom Risotto",
@"Pig spit-roast", @"goat", @"beefed up beef", @"squidles",
@"whale", @"crabbies", @"quack", @"Instant Noodle with Egg",
@"Noodle with BBQ Pork", @"Japanese Noodle with Pork",
@"Green Tea", @"Thai Shrimp Cake", @"Angry Birds Cake",
@"Ham and Cheese Panini", nil];
}
我想從服務中加載所有食品一樣,
NSString *soapMessage =[NSString stringWithFormat:
@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
"<soap:Body>"
"<List xmlns=\"http://tempuri.org/\">"
"<Foods></Foods>"
"</List>"
"</soap:Body>"
"</soap:Envelope>"
];
這裏有兩個問題。解析soap響應並將XML轉換爲項目數組。你是否善於分析肥皂? – bbarnhart
是的,我可以解析。只有我不知道從Web服務加載數組 – Mhmt
你想使用第三方XML解析器還是Apple的XML解析器? – bbarnhart