• 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: Problem with NSDragPboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with NSDragPboard


  • Subject: Re: Problem with NSDragPboard
  • From: Dave Hersey <email@hidden>
  • Date: Wed, 12 Mar 2008 00:42:05 -0400

The only thing I can see is that the docs say that you need to send the pasteboard the "types" or "availableTypeFromArray:" selectors before sending "stringForType:", so maybe you're getting screwy log results without that. Does it change if you add a [pb types]; before the last NSLog?

- d

On Mar 11, 2008, at 11:13 PM, Jamie Phelps wrote:

Hi, all. I am working on the Hillegass chapter that covers drag and drop, and I have the following method in my code.

- (void)writeStringToPasteboard:(NSPasteboard *)pb {
   NSLog(@"Writing %@ to pasteboard %@.",self.string, pb);
   // Copy string data to the pasteboard.
   [pb setString:self.string
         forType:NSStringPboardType];
   NSLog(@"%@",[pb stringForType:NSStringPboardType]);
}

Copy and paste work as expected, but drag and drop does not. It pastes a J every time. (The code handles only one character at a time.) When using drag and drop, the above code writes out the correct string to the console in the first NSLog call but the last one prints the J again. Can anyone offer any thoughts about where I might be going wrong in implementing my drag and drop code?

Thanks,
Jamie
_______________________________________________

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


References: 
 >Problem with NSDragPboard (From: Jamie Phelps <email@hidden>)

  • Prev by Date: Prevent click through (Tiger and Leopard)
  • Next by Date: Re: Prevent click through (Tiger and Leopard)
  • Previous by thread: Problem with NSDragPboard
  • Next by thread: Re: Problem with NSDragPboard
  • Index(es):
    • Date
    • Thread