Note that there are some explanatory texts on larger screens.

plurals
  1. POObtaining broken XML followed by full XML from webservice
    primarykey
    data
    text
    <p>In my contact management app i am using webservice to get a large xml data, that contains contact details. i use NSURLConnection class for sending requests. But i am facing problem in while getting the XML . First i get a broken XML and then I am getting the whole XML data . Can anyone figure out what is going wrong in my app. this is my piece of code that i am using.</p> <pre><code>NSData *postData = [postFields dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSString *postLength = [NSString stringWithFormat:@"%d",[postData length]]; NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:[[NSString alloc] initWithString:Url]]]; [request setHTTPMethod:@"POST"]; [request setValue:postLength forHTTPHeaderField:@"Content-Length"]; [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Current-Type"]; [request setHTTPBody:postData]; conn = nil; conn = [[NSURLConnection alloc] initWithRequest:request delegate:self]; </code></pre> <p>and</p> <pre><code>-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [myData appendData:data]; NSString *theXml = [[NSString alloc] initWithData:myData encoding:NSASCIIStringEncoding]; UIAlertView *thealert = [[UIAlertView alloc] initWithTitle:@"the xml" message:theXml delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil]; [thealert show]; [thealert release]; NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:data]; [xmlParser setDelegate:self]; [xmlParser parse]; [xmlParser release]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload