Re: -[NSAttributedString initWithPasteboard:...] - which types are supported?
Re: -[NSAttributedString initWithPasteboard:...] - which types are supported?
- Subject: Re: -[NSAttributedString initWithPasteboard:...] - which types are supported?
- From: Douglas Davidson <email@hidden>
- Date: Mon, 6 Feb 2006 15:55:26 -0800
On Jan 24, 2006, at 6:04 PM, Jim Correia wrote:
Can anyone share what types initWithPasteboard looks for, and in
what preferred order?
It looks like it may be WebArchives, RTFD, RTF, and
NSStringPboardType. Anything else?
When the data is not sourced in a Cocoa application, what alternate
flavors does NSStringPboardType fall back on, and in what order?
I assume you're speaking of NSTextView's pasteboard reading. The
answer is that the list of types depends on the text view's settings--
for example, whether it's rich text, accepts graphics, and so forth--
and furthermore may change both in content and in ordering from one
release to another. The list can be obtained using -
readablePasteboardTypes, and changed by overriding that. The actual
use of it is via
preferredPasteboardTypeFromArray:restrictedToTypesFromArray:, which
pretty much does the obvious thing but can also be overridden. Then
the actual reading is done with readSelectionFromPasteboard:type:,
which should be overridden if you add new types. The comments in
NSTextView.h describe the process fairly well.
Douglas Davidson
_______________________________________________
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