Re: pasteboard issues
Re: pasteboard issues
- Subject: Re: pasteboard issues
- From: Brian Amerige <email@hidden>
- Date: Sun, 11 Feb 2007 13:24:33 -0500
Ahhh. Thanks! Now that makes sense as for why my attempt at using
NSFilenamesPboard Type for an array with arrays didn't work --- but
now, more importantly (as I'd prefer to do this), why didn't my
custom pasteboard-type work?
I'll refresh your memory by copying/pasting that example below:
static NSString *localRegistryPboardType = @"localRegistryPboardType";
- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray
*)items toPasteboard:(NSPasteboard *)pboard
{
//snip
[pboard declareTypes:[NSArray
arrayWithObjects:NSFilenamesPboardType, localRegistryPboardType, nil]
owner:nil];
NSMutableArray *files = [NSMutableArray array];
//Some enumerator stuff that adds objects to files (snip)
[pboard setPropertyList:files forType:NSFilenamesPboardType];
[pboard setPropertyList:items forType: localRegistryPboardType];
NSLog(@"%@", [pboard propertyListForType:localRegistryPboardType]);
return YES;
}
Like I said before, NSFilenamesPboardType sets nicely, and I can read
the array of paths (which are indeed PB-compatible) from the
propertylist. The problem is, by custom PBoard doesn't. I was under
the assumption that custom PBoard types were open to a multitude of
object-types --- is this correct?
Thanks in advance,
Brian.
On Feb 11, 2007, at 8:06 AM, mmalc crawford wrote:
On Feb 10, 2007, at 8:13 PM, Brian Amerige wrote:
NSArray *objectsArray = [NSArray arrayWithObjects:files, items,
nil];
[pboard setPropertyList:objectsArray
forType:NSFilenamesPboardType];
I should have looked more closely at the type:
NSFilenamesPboardType requires an array of NSString objects (that
represent file names) -- you can't add arbitrary types to the array):
<http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/Classes/NSPasteboard_Class/Reference/
Reference.html#//apple_ref/doc/c_ref/NSFilenamesPboardType>
mmalc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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