• 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: glenn andreas <email@hidden>
  • Date: Fri, 16 Oct 2009 16:23:29 -0500


On Oct 16, 2009, at 3:51 PM, Sean McBride wrote:

On 10/15/09 6:34 AM, Timothy Stafford Larkin said:

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.

That seems quite dangerous, especially in a GC app. Creating such an NSNumber will not keep a strong reference to "object", and so it risks getting prematurely collected. If you do do this, better CFRetain the object first.


And that isn't enough to help if you use some sort of pasteboard/ scrapbook manager to store the dragging pasteboard, quit the app, and later relaunch it and try to drag the archived pasteboard from you pasteboard manager app.




Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures, fractals, art



_______________________________________________

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>)
 >Re: Can I make custom pasteboard type for an object reference? (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: Serial comm in Cocoa?
  • Next by Date: Re: NSArrayController performance using NSManagedObject content on 10.6 [SOLVED]
  • 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