• 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: Can I make custom pasteboard type for an object reference?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I make custom pasteboard type for an object reference?


  • Subject: Re: Can I make custom pasteboard type for an object reference?
  • From: Graham Cox <email@hidden>
  • Date: Thu, 15 Oct 2009 21:40:18 +1100


On 15/10/2009, at 9:34 PM, Timothy Stafford Larkin wrote:

I messed around with this problem for some time, before I gave up
trying to be clever and cast the pointer as an unsigned long.

NSNumber *p = [NSNumber numberWithUnsignedLong:(unsigned long) object];

The number can be added to a pasteboard. Or if dragging more than one
object, NSNumbers can be added to an NSArray, and the array written to
the pasteboard.


You don't have to actually pass the data through the pasteboard if it's only moving it from one place to another within your app. You could just store the objects in some global (or better, class static) and then fetch them when you paste.

--Graham


_______________________________________________

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: 
 >Can I make custom pasteboard type for an object reference? (From: Rick Mann <email@hidden>)
 >Re: Can I make custom pasteboard type for an object reference? (From: Timothy Stafford Larkin <email@hidden>)

  • Prev by Date: Re: Can I make custom pasteboard type for an object reference?
  • Next by Date: NSArrayController performance using NSManagedObject content on 10.6
  • Previous by thread: Re: Can I make custom pasteboard type for an object reference?
  • Next by thread: Re: Can I make custom pasteboard type for an object reference?
  • Index(es):
    • Date
    • Thread