NSMultipleTextSelectionPboardType not working
NSMultipleTextSelectionPboardType not working
- Subject: NSMultipleTextSelectionPboardType not working
- From: André Pang <email@hidden>
- Date: Fri, 8 Aug 2008 14:06:48 +1000
Hi,
I'm trying to read some NSMultipleTextSelectionPboardType data off the
pasteboard:
NSData* data = [pboard dataForType:NSMultipleTextSelectionPboardType];
I've verified that the pasteboard is holding the data using -
[NSPasteboard availableTypeFromArray:], but I'm encountering two
oddities. First, I expected the data to be in an NSArchiver format,
as is the standard for pasteboard data, but it seems to be a property
list instead. If I write out the raw data to a file, the actual data
on the pasteboard looks like this if you dump it to a file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/
PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<integer>1</integer>
<integer>1</integer>
<integer>1</integer>
</array>
</plist>
which seems a little bizarre. (It's not even a binary plist?)
Second, no matter what text is selected on the pasteboard, the only
elements in the array for the multiple selection is an NSNumber of 1.
I get one NSNumber for each selection. So, if I have the text
foo bar
and select the "foo" and "bar" separately, I receive an array of two
NSNumbers, both of which are 1. If I have four text selections on the
pasteboard, no matter what the original text is, I receive an array of
four NSNumbers, all of which are 1. I've been using TextEdit and
Xcode as the source applications for the pasteboard selections, and
both of them exhibit this behaviour.
I'm presuming this is a bug in NSTextView (it doesn't write
NSMultipleTextSelectionPboardType to the paste board properly) and
that I should file a radar, but I thought I'd double-check to make
sure I'm not doing anything very silly first. Googling for
NSMultipleTextSelectionPboardType turns up nothing helpful.
Thanks all!
--
% Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden