Re: inserting images in NSTextView
Re: inserting images in NSTextView
- Subject: Re: inserting images in NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Thu, 7 Feb 2002 16:51:44 -0800
On Thursday, February 7, 2002, at 04:26 PM, Jake MacMullin wrote:
I want to programmatically insert images in to a NSTextView. I know
that I can do this by using replaceDataInRangeWithRTFD(NSData) (using
the Java API's). But how do I get my image in to a NSData object? If
possible, I don't want to have to read the data from a file each time,
but include the image as a resource within my Application Bundle.
In the text storage, an attachment is stored as an NSAttachmentCharacter
with an NSAttachmentAttributeName attribute whose value is an
NSTextAttachment. You can create an NSTextAttachment with an
NSFileWrapper that points at your image file. See NSTextAttachment.h
for more information.
Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.