Parser line break if string contains –

Posted by pask on Stack Overflow See other posts from Stack Overflow or by pask
Published on 2010-12-22T10:35:00Z Indexed on 2010/12/22 13:54 UTC
Read the original article Hit count: 281

Hi all,

My NSXMLParser breaks on this string:

<title>AAA &#8211; BCDEFGQWERTYUIO</title>

I parsed it in this way, hope is the right way:

- (void) parser: (NSXMLParser *) parser foundCharacters: (NSString *) string{
[...]
if ([currentElement isEqualToString:@"title"]) {
    if (![string isEqualToString:@""]) {
            [title addObject:string];
            NSLog(@"str: %@", string);
    }
}

it returns me:

str: AAA
str: -
str: BCDEFGQWERTYUIO

But i want to return a single string:

str: AAA - BCDEFGQWERTYUIO

because it's the correct title.

Any idea?

Thanks.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about Xml