Re: struct into a pasteboard
Re: struct into a pasteboard
- Subject: Re: struct into a pasteboard
- From: Bill Bumgarner <email@hidden>
- Date: Sat, 22 Dec 2007 12:20:27 -0800
On Dec 22, 2007, at 11:46 AM, Lorenzo wrote:
I have to put this struct into a pasteboard.
Since it contains an NSString it seems that I cannot convert it to an
NSValue nor NSData in one shot only. Of course I know that I can put
any
value manually into an NSDictionary. The problem is that if I modify
the
struct I wouldn't like to go and modify the dictionary. I would like
to get
this done automatically. Is a way to do that?
A couple of comments:
- why isn't this a subclass of NSObject? The memory overhead will be
4 bytes for the isa pointer and you can still treat it as a struct if
you want (foo->mapOn, for example).
- you can use NSArchiver/NSUnarchiver to shove the data onto the
pasteboard. You don't need to have a root object to do so. But
going this route would be easier if it was just a subclass of NSObject.
_______________________________________________
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