• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: pasteboard issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: pasteboard issues
      • From: Uli Kusterer <email@hidden>
References: 
 >pasteboard issues (From: Brian Amerige <email@hidden>)
 >Re: pasteboard issues (From: mmalc crawford <email@hidden>)

  • Prev by Date: Re: Preference Pane Controller
  • Next by Date: Re: Very strange Cocoa application issue.
  • Previous by thread: Re: pasteboard issues
  • Next by thread: Re: pasteboard issues
  • Index(es):
    • Date
    • Thread