Re: Problem with NSDragPboard
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