How can I do summation fields of soap web service in ios? -
i want summation fields of web service.
i have 4 label.it show me fields of soap web service.my 3 labels ok dont know how collect total ??
label1(amountx)=100,label2(amounty)=200,label3(amountz)=300,total(amountx+amounty+amountz) = (it must 600)
didstart
-(void)parser:(nsxmlparser *)parser didstartelement:(nsstring *)elementname namespaceuri: (nsstring *)namespaceuri qualifiedname:(nsstring *)qname attributes:(nsdictionary *)attributedict{ if ( [elementname isequaltostring:@"amountx"] ) { if (!soapresults) { soapresults = [[nsmutablestring alloc] init]; } recordresults = yes; } if ( [elementname isequaltostring:@"amounty"] ) { if (!soapresults) { soapresults = [[nsmutablestring alloc] init]; } recordresults = yes; } if ( [elementname isequaltostring:@"amountz"] ) { if (!soapresults) { soapresults = [[nsmutablestring alloc] init]; } recordresults = yes; } if ( [elementname isequaltostring:@"total"] ) { if (!soapresults) { soapresults = [[nsmutablestring alloc] init]; } recordresults = yes; }
didend
- (void)parser:(nsxmlparser *)parser didendelement:(nsstring *)elementname namespaceuri: (nsstring *)namespaceuri qualifiedname:(nsstring *)qname{ if ( [elementname isequaltostring:@"amountx"] ) { label1.text = soapresults ; soapresults = nil; recordresults = no; } if ( [elementname isequaltostring:@"amounty"] ) { label2.text = soapresults ; soapresults = nil; recordresults = no; } if ( [elementname isequaltostring:@"amountz"] ) { label3.text = soapresults ; soapresults = nil; recordresults = no; } // total ??? if ( [elementname isequaltostring:@"total"] ) { total.text = soapresults ; soapresults = nil; recordresults = no; }
Comments
Post a Comment