Re: NSPasteboard and data types
Re: NSPasteboard and data types
- Subject: Re: NSPasteboard and data types
- From: Michael Hoy <email@hidden>
- Date: Sat, 18 Jul 2009 14:40:32 -0400
Dave,
I've worked with UIPasteboard, which I'm assuming is similar.
dataForType: will contain string data if it's a type such as UTF8
text. My own "PasteboardItem" class had just "data" (NSData) and
"type" (NSString) properties, and it's worked fine for everything.
Once you have the type and data, you can then write methods to convert
to strings or whatnot.
Michael Hoy
email@hidden
On Jul 18, 2009, at 1:52 PM, Dave DeLong wrote:
Hi everyone,
I'm playing around with NSPasteboard in 10.5 and want to basically
create a copy of the generalPasteboard. I've got two classes:
DDPasteboard and DDPasteboardItem. DDPasteboard has a to-many
relationship with DDPasteboardItem.
What I'm wondering is this: do I need to have separate string and
data properties in DDPasteboardItem? I see that I can grab
stringForType: and dataForType: from the pasteboard, but what's the
difference between them (other than one returning an NSString and
the other an NSData)? In the documentation I see that
stringForType: just invokes dataForType:, but is there ever an
instance where stringForType: would return something different than
can be inferred from dataForType:?
Thanks,
Dave DeLong
_______________________________________________
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
_______________________________________________
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