• 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
NSTextView.preferredPasteboardTypeFromArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextView.preferredPasteboardTypeFromArray


  • Subject: NSTextView.preferredPasteboardTypeFromArray
  • From: Chris Idou <email@hidden>
  • Date: Mon, 26 Jan 2009 20:36:10 -0800 (PST)

I'm trying to make an NSTextView do something rational when someone drags a token from an NSTokenField. So I've got the NSTokenField producing a custom drag type I've called TokenPboardType.

I've inherited from NSTextView and redefined readablePasteboardTypes to be:

- (NSArray*)readablePasteboardTypes; {
NSMutableArray*rtn = [NSMutableArrayarrayWithObject:TokenPboardType];
[rtn addObjectsFromArray:[superreadablePasteboardTypes]];
returnrtn;
}

and I redefined - (BOOL)readSelectionFromPasteboard:(NSPasteboard*)pboard type:(NSString*)type;

to do what I want.

My trouble is that when I redefine - (NSString*)preferredPasteboardTypeFromArray:(NSArray*)availableTypes restrictedToTypesFromArray:(NSArray*)allowedTypes;

This method's list of allowedTypes when I do the drag doesn't include my TokenPboardType. Now if I return TokenPboardType anyway, it seems to work. my readSelectionFromPasteboard gets called with TokenPboardType and it all seems to work. But it feels like I'm doing the wrong thing somehow, since from the doco it sounds like you shouldn't return a type that is not in the allowedTypes.

Comments?


      Stay connected to the people that matter most with a smarter inbox. Take a look http://au.docs.yahoo.com/mail/smarterinbox
_______________________________________________

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

  • Follow-Ups:
    • Re: NSTextView.preferredPasteboardTypeFromArray
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: CoreData silently failing to insert?
  • Next by Date: Re: How to catch and log EXC_BAD_ACCESS?
  • Previous by thread: Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare
  • Next by thread: Re: NSTextView.preferredPasteboardTypeFromArray
  • Index(es):
    • Date
    • Thread