将 NSData 对象中的 rtf 数据转换为 NSString 对象
我正在 iOS 上工作,我想读取 NSData 中的 rtf 数据(实际上它是核心数据实体中的一个属性)。我使用以下代码:
NSString *temp = [NSString stringWithUTF8String:[self.task.notes bytes]];
NSLog(@"%@ %i", temp, [temp length]);
控制台产生消息“rtfd 4”。但我正在寻找 rtfd 原始数据。 感谢您的帮助, 何塞.
I'm working on iOS and I want to read rtf data thats in an NSData (actually its an attribute in a core data entity). I'm using the following code:
NSString *temp = [NSString stringWithUTF8String:[self.task.notes bytes]];
NSLog(@"%@ %i", temp, [temp length]);
The console yields the message "rtfd 4". But I'm looking for the rtfd raw data.
Thank you for your help,
Jose.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能有帮助,也可能没有帮助
this may or not be of any help
如果您想要 RTFD 数据流的原始字符串,则可以在 Swift 中使用以下代码:
如果您有 RTF 数据流,请使用以下代码:
If you want the raw string of a RTFD data stream, then you use this code in Swift:
In case you have a RTF data stream, use this code: