• 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
NSTokenField - drag and drop contacts from Address Book panel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTokenField - drag and drop contacts from Address Book panel


  • Subject: NSTokenField - drag and drop contacts from Address Book panel
  • From: Sarat Kongara <email@hidden>
  • Date: Tue, 20 Dec 2005 16:04:35 -0800

Hi,
I have a window with two NSTokenFields (To: and From:) and I like to be able
to drag and drop contacts from the Address Book panel to these token fields.

I registered the draggedTypes.

[fromField registerForDraggedTypes:[NSArray
arrayWithObject:@"ABPeopleUIDsPboardType"]];
[toField registerForDraggedTypes:[NSArray
arrayWithObject:@"ABPeopleUIDsPboardType"]];

I set a controller object as the delegate of the token fields and
implemented the token field delegate method.

- (NSArray *)tokenField:(NSTokenField *)tokenField
readFromPasteboard:(NSPasteboard *)pboard

This method never gets called.

I searched the mailing list to see how to implement drag and drop for
NSTextFields. I found this useful link
http://www.cocoabuilder.com/archive/message/cocoa/2002/7/9/55542 (the idea
is to create a subclass of NSTextField and a subclass of NSTextView for the
custom field editor)

I tried the same approach for NSTokenFields but it doesn't seem to work. I
found this link to confirm it.
http://www.cocoabuilder.com/archive/message/cocoa/2005/7/8/141077

Any suggestions on how to do implement this? Thanks.

Sarat
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Add a close button in NSTabViewItem
  • Next by Date: How to programatically set the search field sting value in an NSOpenPanel
  • Previous by thread: Add a close button in NSTabViewItem
  • Next by thread: How to programatically set the search field sting value in an NSOpenPanel
  • Index(es):
    • Date
    • Thread