• 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: 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


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>)
 >Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question) (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Re: context menu item sample from apple code samples still valid?
  • Next by Date: Now contents of the layer not being rotated [was Re: Rotating a CALayer more than once is not working ]
  • Previous by thread: Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)
  • Next by thread: Loading a view XIB with different owner types?
  • Index(es):
    • Date
    • Thread