Re: How to archive structs like NSRect
Re: How to archive structs like NSRect
- Subject: Re: How to archive structs like NSRect
- From: Gordon Apple <email@hidden>
- Date: Mon, 12 Nov 2007 12:16:25 -0600
That doesn't work. NSKeyedArchiver chokes on it. That's currently high
on my gripe list. I resorted to class-testing and wrapping NSValues in
NSData, although I may change to the string approach for rects. I am
thankful that you can now at least archive NSColor with a keyed archiver. I
wish they would include NSValues. IMHO, if you can put it into an array or
a dictionary, you should be able to archive it.
BTW, if you take my approach of class-testing be sure and use
"isKindOf", not "isMemberOf", because NSValue is not just a class -- it is a
class cluster. (Found this out the hard way).
> Message: 3
> Date: Mon, 12 Nov 2007 09:27:33 -0500
> From: Hank Heijink <email@hidden>
> Subject: Re: How to archive structs like NSRect
> To: Andrew Ebling <email@hidden>
> Cc: "email@hidden" <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
> You can wrap an NSRect in an NSValue, but I just use NSRectToString
> and NSStringToRect to make it an object.
>
> Hope that helps,
> Hank
>
> On Nov 12, 2007, at 9:12 AM, Andrew Ebling wrote:
_______________________________________________
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