Re: Subclassing NSCell (was Re: Problem With implementing copyWithZone)
Re: Subclassing NSCell (was Re: Problem With implementing copyWithZone)
- Subject: Re: Subclassing NSCell (was Re: Problem With implementing copyWithZone)
- From: Thaddeus Cooper <email@hidden>
- Date: Mon, 8 Oct 2007 14:02:23 -0700
Paul --
It works wonderfully well. :-)
Thanks very much.
Thaddeus O. Cooper
(email@hidden)
On Oct 8, 2007, at 1:50 PM, Paul Robinson wrote:
No problem! Let me know if it works.
cheers,
Paul
On 8-Oct-07, at 4:41 PM, Thaddeus Cooper wrote:
Paul --
I just read your blog posting. Thank you very much. I will try
this. :-)
Thanks.
Thaddeus O. Cooper
(email@hidden)
On Oct 8, 2007, at 1:32 PM, Paul Robinson wrote:
On Oct 7, 2007, at 8:16 PM, Thaddeus Cooper wrote:
I am only implementing copyWithZone: because it is required
for the composite NSCell subclass that I am working on which
combines multiple pieces of data from an NSManagedObject
subclass into a single cell, so I believe that I want an
absolute duplicate of what is already in the store.
I also recently ran across the mysterious missing copyWithZone:
when trying to use a custom NSCell with NSManagedObjects.
I blogged about it at:
http://kupuk.com/2007/10/08/custom-nscells-with-nsmanagedobjects/
The short answer is that you need to override the setObjectValue:
method (which tries to copy your uncopyable NSManagedObject) in
your custom NSCell to convert your NSManagedObject into an
NSValue (which is copyable).
Paul
_______________________________________________
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