• 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: [RESOLVED] Re: Curious about copyWithZone message from NSArrayController in "GC required" project
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RESOLVED] Re: Curious about copyWithZone message from NSArrayController in "GC required" project


  • Subject: Re: [RESOLVED] Re: Curious about copyWithZone message from NSArrayController in "GC required" project
  • From: Luke Evans <email@hidden>
  • Date: Thu, 14 Feb 2008 16:43:03 -0800

Closure:

Not that this is necessarily of any use to anyone, but the "something seriously wrong" causing -copyWithZone to be sent to an NSManagedObject was the following:

I had an NSArrayController set up to collect a set of NSManagedObjects from a master view selection 'upstream'. I had then bound a table view to this in one of its columns, *but* I had only set the Controller Key (to arrangedObjects), I had not entered a Model Key Path i.e. set up a path to the content to be rendered in each cell of the column.

Under these circumstances, the objects referenced in arrangedObjects (which happen to be Core Data objects) get sent a -copyWithZone.

So this is why the problem "went away" when I had restructured my bindings before, I had clearly 'done the right thing' and the problem vanished. I've just repeated the earlier mistake and so can report the reason for the message.

-- Lwe

On 13-Jan-08, at 3:37 PM, Luke Evans wrote:

O.K...

So, I just did this and found it wasn't being called any longer. So, I suspect your original intuition was right - there was something badly wrong with my code (which thankfully I have now rectified - though its frustrating not to be able to nail the original reason now).

One change that may have had a bearing here was that I had inadvertently commented out some code to return an NSCollectionViewItem in a subclass of NSCollectionView that was generating UI for the B objects. I fixed this yesterday. It's possible that something in NSCollectionView was trying to do its best with just the prototype item and the list of B's from the NSArrayController. Anyway, that's pure speculation, and perfectly well covered by your comment that "something is seriously wrong with your code"!

I'm deleting the spurious copyWithZone now, safe in the knowledge that it's just not something that I should need to implement until such time as I have a real need for a copy constructor in that class.

Thanks.

-- Lwe


On 13-Jan-08, at 2:54 PM, Bill Bumgarner wrote:

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?

_______________________________________________

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


  • Prev by Date: Re: Changing app menu title programmatically
  • Next by Date: How do I pass a model class information in the MyDocument subclass?
  • Previous by thread: Re: NSShadow changes on 10.5.2?
  • Next by thread: How do I pass a model class information in the MyDocument subclass?
  • Index(es):
    • Date
    • Thread