Using NSXMLParser with CDATA

前端 未结 2 1511
说谎
说谎 2020-12-05 16:04

I\'m parsing an RSS feed with NSXMLParser and it\'s working fine for the title and other strings but one of the elements is an image thats like



        
2条回答
  •  既然无缘
    2020-12-05 16:30

    You can use

    - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock
    {
        NSString *someString = [[NSString alloc] initWithData:CDATABlock encoding:NSUTF8StringEncoding];
    }
    

提交回复
热议问题