Pasteboard problems
Pasteboard problems
- Subject: Pasteboard problems
- From: Dave Riggle <email@hidden>
- Date: Sat, 20 Sep 2003 17:09:54 -0700
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.