0

I have use following code for call soap web service, Here in string i get all values but i want it in array to display in tableview.How to store this in array please suggest way.Or how to fetch records in form of array?

From where i have get code

    -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *) namespaceURI qualifiedName:(NSString *)qName
    attributes: (NSDictionary *)attributeDict
    {
        if( [elementName isEqualToString:@"GetCenterResult"])
        {
            if(!soapResults)
            {
                soapResults = [[NSMutableString alloc] init];
            }
            recordResults = TRUE;
        }
    }
    -(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
    {
        if( recordResults )
        {
            NSLog(@"-%@",string);

            [soapResults appendString: string];
            mutabl_arr = [soapResults copy];
           NSLog(@"%@",mutabl_arr);


          //  NSLog(@"First make: %@", [mutabl_arr objectAtIndex:0]);
        }

    }
    -(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
    {

        if( [elementName isEqualToString:@"GetCenterResult"])
        {
            recordResults = FALSE;
            abc1.text = soapResults;


            NSLog(@"Data from XML file  ==  %@",soapResults);
            //mutabl_arr = [soapResults copy];
            NSLog(@"Arreay%@",mutabl_arr);



            }


  }

Error __NSCFString Comes if i will trying to access mutabl_arr using its index.

Smit Saraiya
  • 391
  • 1
  • 5
  • 26

0 Answers0