• 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: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)
      • From: Gustavo Pizano <email@hidden>
References: 
 >Encoding a Custom Object which has a CALayer instance Variable (newbie Question) (From: Gustavo Pizano <email@hidden>)
 >Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question) (From: "Michael Ash" <email@hidden>)
 >Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question) (From: Gustavo Pizano <email@hidden>)

  • Prev by Date: Re: open package installer in bundle resources directory not working
  • Next by Date: Re: setNeedsDisplay Equivalent for NSMenuItem?
  • Previous by thread: Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)
  • Next by thread: Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)
  • Index(es):
    • Date
    • Thread