-3

I have created a connection using NSURLConnection (Asynchronous web-service call).

i have added all delegates like

-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
    [m_webData setLength: 0];
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    [m_webData appendData:data];
}
-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
    NSLog(@"ERROR with theConenction");
    [connection release];
    [m_webData release];
}

i am receiving data ... but i am sending Datable, i do not know how to parse data, how to read data.

my web-service get hit and sends data but how do parse receive datable.

Shaik Riyaz
  • 11,204
  • 7
  • 53
  • 70

1 Answers1

0

First , as you have received your entire data in m_webData (assuming it is an instance of NSObject) , use this to parse xml using NSXML parser or TBXML parser. Now, real point is that you have to learn how to parse using either of two or any other i don't know (depending on your data received- JSON or XML). You can learn :

parsing from Xml parsing in iOS tutorial

also TBXML from :http://www.tbxml.co.uk/TBXML/Guides_-_Loading_an_XML_document.html

or http://www.raywenderlich.com/553/xml-tutorial-for-ios-how-to-choose-the-best-xml-parser-for-your-iphone-project

It is better for you to learn first and then use it instead of asking for code.

Community
  • 1
  • 1
Rana
  • 451
  • 4
  • 16