iphone - Objective-C/Cocoa Touch 中的 HTML 字符解码

首先,我发现了这个: Objective C HTML escape/unescape ,但它对我不起作用。

我的编码字符(来自 RSS 提要,顺便说一句)如下所示:&

我在网上搜索并找到了相关的讨论,但没有解决我的特定编码,我认为它们被称为十六进制字符。

最佳答案

查看我的 NSString category for HTML .以下是可用的方法:

- (NSString *)stringByConvertingHTMLToPlainText;
- (NSString *)stringByDecodingHTMLEntities;
- (NSString *)stringByEncodingHTMLEntities;
- (NSString *)stringWithNewLinesAsBRs;
- (NSString *)stringByRemovingNewLinesAndWhitespace;

https://stackoverflow.com/questions/1105169/

相关文章:

ios - 带有透明孔的 CALayer

ios - 对 UITableView 使用 didSelectRowAtIndexPath 或 p

iphone - 关闭呈现的 View Controller

objective-c - iOS - 如何以编程方式设置 UISwitch

ios - 检查 AVPlayer 的播放状态

ios - "From View Controller"使用 UIViewControllerCon

objective-c - iOS8 - 约束含糊地暗示高度为零

ios - 在单行 UILabel 旁边居中 NSTextAttachment 图像

ios - 设置 UILabel 行距

ios - UICollectionViewCell 上的长按手势