我有以下代码
DownloadOperations *DataObj=[[DownloadOperations alloc]init];
[DataObj ID];
NSString *body=[NSString stringWithFormat:@"<?xml version='1.0' encoding='utf-8'?><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><GetDocumentUpdatedInfo xmlns='http://tempuri.org/'><DocumentID>%@</DocumentID></GetDocumentUpdatedInfo></soap:Body></soap:Envelope>", [DataObj ID]];
NSLog(@"Body %@", body);
此代码中的 [DataObj ID]
是NsMutablearray
,NSString
(正文)是soap Request
,需要string
值。如何让soap request
针对array
的每个元素进行迭代运算?
答案 0 :(得分:1)
int loopCount = 0;
while (loopCount < [[DataObj ID] count]){
//Do stuff with [[DataObj ID] objectAtIndex:loopCount]
loopCount++;
}