• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: inserting images in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >inserting images in NSTextView (From: Jake MacMullin <email@hidden>)

  • Prev by Date: burning cd with cocoa
  • Next by Date: Re: Disable the drag snap-back?
  • Previous by thread: inserting images in NSTextView
  • Next by thread: burning cd with cocoa
  • Index(es):
    • Date
    • Thread