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: "Michael Ash" <email@hidden>
- Date: Sat, 13 Dec 2008 18:06:27 -0500
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