Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)

2008-12-14 Thread Gustavo Pizano
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

Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)

2008-12-13 Thread Gustavo Pizano
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. G On 13.12.2008, at 6:16, Michael Ash wrote: On Fri, Dec 12, 2008 at 3:43 PM, Gustavo Pizano gustavxcodepic...@gmail.com wrote: Hello. I

Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)

2008-12-13 Thread Michael Ash
On Sat, Dec 13, 2008 at 5:02 AM, Gustavo Pizano gustavxcodepic...@gmail.com 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.

Encoding a Custom Object which has a CALayer instance Variable (newbie Question)

2008-12-12 Thread Gustavo Pizano
Hello. I want to send the following an object in a drag-n-drop operation, so I need to transform it to a NSData so I have this object @interface Ship : NSObject NSCoding { int size; int impacts; ShipLocation * location; CALayer * shipImageLayer;

Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)

2008-12-12 Thread Michael Ash
On Fri, Dec 12, 2008 at 3:43 PM, Gustavo Pizano gustavxcodepic...@gmail.com wrote: Hello. I want to send the following an object in a drag-n-drop operation, so I need to transform it to a NSData so I have this object @interface Ship : NSObject NSCoding { int size; int

Re: Encoding a Custom Object which has a CALayer instance Variable (newbie Question)

2008-12-12 Thread Gustavo Pizano
On 13.12.2008, at 6:16, Michael Ash wrote: When you get to an object, you can simply encode it using [coder encodeObject:obj forKey:@key]. Of course obj must implement NSCoding as well, otherwise this will not work. For your own classes, you'll need to implement NSCoding for everything that