FROM : Bill Bumgarner
DATE : Sun Jan 13 23:54:56 2008
On Jan 13, 2008, at 2:48 PM, Luke Evans wrote:
>> >First and foremost, -copyWithZone: has absolutely nothing to do
>> with the differences between GC and non-GC. As its name implies,
>> it is all about copying an object, something that must be done in
>> either GC or non-GC.
>>
> Makes sense. I was wondering though if the fact I had a property
> declared on A to get the array of B's made a difference. Reading
> the docs on properties highlights some differences between GC and
> non-GC, though from what you are saying, this should not effect a
> copy.
Only if you declared the property to use 'copy' on set. Then, as
expected, it would attempt to copy the object.
>> >So -- first question -- what is triggering the -copyWithZone:
>> being sent to an instance of B in the first place?
>
> Perhaps I need to take a look to see _exactly_ who is sending the
> copyWithZone message to B, but the only time I've had this manifest
> is when I've A's property that returns the array of B's bound as the
> content of the NSArrayController - which generates some UI for the
> list of B's. I've used put B's on all manner of collections
> (arrays, sets) directly, with no hint of anybody calling
> "copyWithZone".
You mentioned that you had implemented a -copyWithZone: on B? Can
you set a breakpoint on that and see what backtrace barfs up as a
result?
DATE : Sun Jan 13 23:54:56 2008
On Jan 13, 2008, at 2:48 PM, Luke Evans wrote:
>> >First and foremost, -copyWithZone: has absolutely nothing to do
>> with the differences between GC and non-GC. As its name implies,
>> it is all about copying an object, something that must be done in
>> either GC or non-GC.
>>
> Makes sense. I was wondering though if the fact I had a property
> declared on A to get the array of B's made a difference. Reading
> the docs on properties highlights some differences between GC and
> non-GC, though from what you are saying, this should not effect a
> copy.
Only if you declared the property to use 'copy' on set. Then, as
expected, it would attempt to copy the object.
>> >So -- first question -- what is triggering the -copyWithZone:
>> being sent to an instance of B in the first place?
>
> Perhaps I need to take a look to see _exactly_ who is sending the
> copyWithZone message to B, but the only time I've had this manifest
> is when I've A's property that returns the array of B's bound as the
> content of the NSArrayController - which generates some UI for the
> list of B's. I've used put B's on all manner of collections
> (arrays, sets) directly, with no hint of anybody calling
> "copyWithZone".
You mentioned that you had implemented a -copyWithZone: on B? Can
you set a breakpoint on that and see what backtrace barfs up as a
result?
| Related mails | Author | Date |
|---|---|---|
| Luke Evans | Jan 13, 05:03 | |
| Bill Bumgarner | Jan 13, 06:31 | |
| Luke Evans | Jan 13, 23:48 | |
| Bill Bumgarner | Jan 13, 23:54 | |
| Luke Evans | Jan 14, 00:37 | |
| Luke Evans | Feb 15, 01:43 |






Cocoa mail archive

