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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to