• 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't drag a custom data object.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't drag a custom data object.


  • Subject: Re: Can't drag a custom data object.
  • From: Graham Cox <email@hidden>
  • Date: Tue, 27 Apr 2010 17:15:58 +1000

On 27/04/2010, at 5:05 PM, Billy Flatman wrote:

> Hi Jens,
>
> Thanks for your help. I've been trying to get the option 1 approach to work, but I don't know what I'm meant to do with my NSValue. I can't find how to convert it to an NSData type.


NSData* data = [NSKeyedArchiver archivedDataWithRootObject:myValue];

>> (3) Implement a way to serialize the object into data or a dictionary/array. Implementing the NSCopying protocol is a standard way to do that.


I think perhaps Jens meant SCoding, not NSCopying. If you have an object that you want to be able to cut/paste or drag, adopt the NSCoding protocol and archive it directly (as above, but don't bother with a NSValue).

--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't drag a custom data object. (From: Billy Flatman <email@hidden>)
 >Re: Can't drag a custom data object. (From: Jens Alfke <email@hidden>)
 >Re: Can't drag a custom data object. (From: Billy Flatman <email@hidden>)

  • Prev by Date: Re: Can't drag a custom data object.
  • Next by Date: Re: [iPhone] File coping application
  • Previous by thread: Re: Can't drag a custom data object.
  • Next by thread: XCode 3.2.2 Hangs after Clean All but Previous Version Doesn't
  • Index(es):
    • Date
    • Thread