your XML may contain special characters like accented words, try with this:
-(void) connectionDidFinishLoading:(NSURLConnection *) connection {
NSString *XMLResponse = [[NSString alloc]initWithBytes:[webData mutableBytes] length:[webData length] encoding:NSISOLatin1StringEncoding];
NSLog(@"xml message: %@, data length: %i", XMLResponse, [webData length]);
if ([XMLResponse hasPrefix:@"[ERR]"]){
[[[UIAlertView alloc]initWithTitle:@"Notification"
message:XMLResponse != nil ? [@"there was an error while trying to load service" stringByAppendingString:XMLResponse]: @"there was an error while trying to load service"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil]show];
_transacWebServCompleto = @"FALSE";
return;
}
xmlParser = [[NSXMLParser alloc] initWithData:[XMLResponse dataUsingEncoding:NSUTF8StringEncoding]];
[xmlParser setDelegate:self];
[xmlParser setShouldResolveExternalEntities:YES];
[xmlParser parse];
}
All I did was:
- take your NSString (XMLResponse) and change the encoding to NSISOLatin1StringEncoding
- initialize your NSXMLParser object (parse) by creating in one step an NSData object using your NSString (XMLResponse) but now encoding with NSUTF8StringEncoding
try it and tell us how did it go!