Re: Trouble getting ISO-8859-1 encoded feed to parse and display
Re: Trouble getting ISO-8859-1 encoded feed to parse and display
- Subject: Re: Trouble getting ISO-8859-1 encoded feed to parse and display
- From: Diederik Meijer | Ten Horses <email@hidden>
- Date: Mon, 24 Nov 2014 19:43:35 +0100
Op 24 Nov 2014, om 19:01 heeft Jens Alfke <email@hidden> het volgende geschreven:
>
>> On Nov 24, 2014, at 9:30 AM, Diederik Meijer | Ten Horses <email@hidden> wrote:
>>
>> I get no errors, but no results from the parser either. I haven't tested against didStartElement, because it seems clear that no data goes into the parser.
>
> Did you implement these delegate methods:
> - (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError;
> - (void)parser:(NSXMLParser *)parser validationErrorOccurred:(NSError *)validationError;
> ?
I have now (see below), doesn’t show me anything in the simulator, will test on one of the erring devices tomorrow, by the way, both of the following lines log the data content out just fine:
NSString *dataString = [[NSString alloc] initWithData:self.dataContainer encoding:NSISOLatin1StringEncoding];
NSString *dataString = [[NSString alloc] initWithData:self.dataContainer encoding:NSWindowsCP1252StringEncoding];
>
> I'm pretty sure that NSXMLParser wouldn't fail without returning any sort of error. If it does, you should file a bug report with Apple once you have a reproducible case.
>
> —Jens
>
- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"PARSE ERROR IN CHANNEL" message:[parseError localizedDescription] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[av show];
NSLog(@"ERROR IN CHANNEL: %@", [parseError localizedDescription]);
}
- (void)parser:(NSXMLParser *)parser validationErrorOccurred:(NSError *)validationError {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"VALIDATION ERROR IN CHANNEL" message:[validationError localizedDescription] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[av show];
NSLog(@"ERROR IN CHANNEL: %@", [validationError localizedDescription]);
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden