Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)
Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)
- Subject: Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)
- From: Gustavo Pizano <email@hidden>
- Date: Sun, 14 Dec 2008 09:37:39 +0100
Hello, yes in fact, that was what I did, I set up a NSImage instance
variable so once dragged to the other View I just used the info of the
NSImage to recreate the layer.
Thanks for your help
On 14.12.2008, at 0:06, Michael Ash wrote:
On Sat, Dec 13, 2008 at 5:02 AM, Gustavo Pizano
<email@hidden> wrote:
Hi, I tried to encode the CAlayer, but when decoding, all the info
of the
layer its lost.
dunno what happened, the other info of the object it's good.
Could be that CALayer doesn't support NSCoding very well. This would
be kind of strange, but not too surprising, as it's a pretty complex
object with a lot of ties to the window server.
In that case you'll have to encode enough information to re-create the
layer instead. You're creating it at some point, so think about how
you do that and what information you use to do it. Encode that
information, and then in your -initWithCoder: you can get all of the
base information back out and use it to create a new CALayer that
matches the old one.
Mike
_______________________________________________
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
_______________________________________________
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