Thanks in Advance
When I m trying to call a webservice getting error with “exc_bad_access”. I’ve put my code below.
This is small part where I got an error:
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSLog(@"DONE. Received Bytes: %d", [webData length]);
NSString *theXML = [[NSString alloc] initWithBytes: [webData mutableBytes] length:[webData length] encoding:NSUTF8StringEncoding];
NSLog(@"%@",theXML);
[theXML release];
if( xmlParser )
{
[xmlParser release];
}
xmlParser = [[NSXMLParser alloc] initWithData: webData]; <--- Error here.
[xmlParser setDelegate:self];
[xmlParser setShouldResolveExternalEntities: YES];
[xmlParser parse];
[activityIndicator stopAnimating];
[connection release];
[webData release];
}
Try to add:
Right after