Re: Pasteboard problems
Re: Pasteboard problems
- Subject: Re: Pasteboard problems
- From: Dave Riggle <email@hidden>
- Date: Sat, 20 Sep 2003 17:35:22 -0700
My routine is actually called "copyToPasteboard". I changed it to
"paste" for posting. Poor choice of words. It is copying to the
pasteboard that I am having trouble with. My routine doesn't put the
list of files onto the pasteboard. Any ideas why?
Dave
On Saturday, September 20, 2003, at 05:09 PM, Dave Riggle wrote:
I need a little help with Copy & Paste. My Paste routine doesn't seem
to put anything onto the pasteboard. I have very similar code for
Drag & Drop that works fine. Any ideas why propertyListForType is
null right after I set it? The code & console output are below.
Dave
------
- (void)paste:(id)sender
{
BOOL result;
NSArray *files;
NSPasteboard *pb = [NSPasteboard generalPasteboard];
// Declare that we can provide files and TIFF
[pboard declareTypes:[NSArray
arrayWithObjects:NSFilenamesPboardType, NSTIFFPboardType, nil]
owner:self];
// Now put the selected files on the pasteboard
files = [self selectedFiles];
result = [pboard setPropertyList:files
forType:NSFilenamesPboardType];
NSLog(@"files = %@", files);
NSLog(@"result = %d", result);
NSLog(@"pboard types = %@", [pboard types]);
NSLog(@"pboard props = %@", [pboard
propertyListForType:NSFilenamesPboardType]);
}
--- Output ---
files = <CFArray 0x2489f70 [0xa01303fc]>{type = mutable-small, count =
1, values = (
0 : /Users/dave/Desktop/Test.jpg
)}
result = 1
pboard types = <CFArray 0x24899d0 [0xa01303fc]>{type = mutable-small,
count = 6, values = (
0 : <CFString 0x24899a0 [0xa01303fc]>{contents =
"NSFilenamesPboardType"}
1 : <CFString 0x2489a10 [0xa01303fc]>{contents = "NeXT TIFF v4.0
pasteboard type"}
2 : <CFString 0x2489a40 [0xa01303fc]>{contents = "NeXT filename
pasteboard type"}
3 : <CFString 0x2489a70 [0xa01303fc]>{contents =
"CorePasteboardFlavorType 0x50494354"}
4 : <CFString 0x248c350 [0xa01303fc]>{contents =
"CorePasteboardFlavorType 0x54494646"}
5 : <CFString 0xa3075000 [0xa01303fc]>{contents = "Apple PICT
pasteboard type"}
)}
pboard props = (null)
_______________________________________________
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.