Problem with NSDragPboard
Problem with NSDragPboard
- Subject: Problem with NSDragPboard
- From: Jamie Phelps <email@hidden>
- Date: Tue, 11 Mar 2008 22:13:21 -0500
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