Re: converting NSData to string
Re: converting NSData to string
- Subject: Re: converting NSData to string
- From: "Adam R. Maxwell" <email@hidden>
- Date: Thu, 6 Jul 2006 20:31:33 -0700
On Jul 6, 2006, at 15:50, Rex Fernando wrote:
Hello,
I have an NSData with rtf data in it. I want an NSString with the
plain text of the data, no tags or images in it. I tried
stringWithData:Encoding:, but couldn't get it to work. Can someone
help me?
Try creating an NSAttributedString with your RTF data.
[[[[NSAttributedString alloc] initWithRTFData:data
documentAttributes:NULL] autorelease] string] should give you an
NSString representation of the RTF (search the docs for RTF to see
more).
Adam
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden