FROM : Mark Williams
DATE : Sat Jul 08 09:04:55 2006
Because I often search the list archives for my information as some
one else might. And because some one else might want to know the
answer to my question as i found it. I will post the link I used and
how I managed to solve this issue.
http://developer.apple.com/samplecode/FancyAbout/listing7.html
That is a link to some sample code that showed me how to read an rtf
file and then display it correctly in a text view.
Basically I read the file in to an NSData object, initialized an
NSAttributedString with that NSData object [[NSAttributedString alloc]
initWithRTF:myObject documentAttributes:NULL] and then used
[[textView textStorage] setAttribtedString:myAtribString] to display
the data.
Looking back on it now the answer was simple but with a huge update
to the project I was working on this simple answer did not seem so at
the time.
On Jul 7, 2006, at 10:04 AM, mmalc crawford wrote:
>
> On Jul 6, 2006, at 3:49 PM, Mark Williams wrote:
>
>> I have a window with an NSTextView. Data is read from an rtf file
>> and should be displayed in this textview. The problem is that I do
>> not know how to display rtf data (as it was formated when the file
>> was made.) in a window. Would some one be able to help me with this?
>
> The answer to this is trivially found in the documentation -- try,
> for example, <http://developer.apple.com/cgi-bin/search.pl?
> q=NSTextView+rtf&num=10&site=default_collection>.
>
> Members of the list are expected to expend reasonable effort in
> finding an answer to their question before posting.
>
> mmalc
>
>
>
DATE : Sat Jul 08 09:04:55 2006
Because I often search the list archives for my information as some
one else might. And because some one else might want to know the
answer to my question as i found it. I will post the link I used and
how I managed to solve this issue.
http://developer.apple.com/samplecode/FancyAbout/listing7.html
That is a link to some sample code that showed me how to read an rtf
file and then display it correctly in a text view.
Basically I read the file in to an NSData object, initialized an
NSAttributedString with that NSData object [[NSAttributedString alloc]
initWithRTF:myObject documentAttributes:NULL] and then used
[[textView textStorage] setAttribtedString:myAtribString] to display
the data.
Looking back on it now the answer was simple but with a huge update
to the project I was working on this simple answer did not seem so at
the time.
On Jul 7, 2006, at 10:04 AM, mmalc crawford wrote:
>
> On Jul 6, 2006, at 3:49 PM, Mark Williams wrote:
>
>> I have a window with an NSTextView. Data is read from an rtf file
>> and should be displayed in this textview. The problem is that I do
>> not know how to display rtf data (as it was formated when the file
>> was made.) in a window. Would some one be able to help me with this?
>
> The answer to this is trivially found in the documentation -- try,
> for example, <http://developer.apple.com/cgi-bin/search.pl?
> q=NSTextView+rtf&num=10&site=default_collection>.
>
> Members of the list are expected to expend reasonable effort in
> finding an answer to their question before posting.
>
> mmalc
>
>
>
| Related mails | Author | Date |
|---|---|---|
| Mark Williams | Jul 7, 00:49 | |
| Mark Williams | Jul 7, 19:01 | |
| mmalc crawford | Jul 7, 19:04 | |
| Mark Williams | Jul 8, 08:33 | |
| Mark Williams | Jul 8, 09:04 | |
| I. Savant | Jul 8, 17:26 |






Cocoa mail archive

