• 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
NSDictionaryController copies objects contained in the dictionary it is controlling?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDictionaryController copies objects contained in the dictionary it is controlling?


  • Subject: NSDictionaryController copies objects contained in the dictionary it is controlling?
  • From: Ron Aldrich <email@hidden>
  • Date: Fri, 17 Oct 2008 16:08:11 -0700

Folks,

I'm trying to use the new NSDictionaryController in a project I'm working on, and I'm running into a bit of trouble.

I have a dictionary which contains a list of MB_Robot objects, sorted by their unique IDs. Each MB_Robot provides the code necessary to operate a single robotic device.

It is important that I only create a single object for each robot.

The problem I'm running into is that when I connect a NSDictionaryController to the dictionary (in order to display it's contents in a view), it attempts to copy the MB_Robot objects (rather than simply keeping a reference to the original objects). This results in the application terminating with:

2008-10-17 15:27:33.723 DiscFactoryTest[7030:10b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** - [MB_MXRobot copyWithZone:]: unrecognized selector sent to instance 0x148a10'

Is this the expected behavior for NSDictionaryController? Is there a way to stop it from copying objects?

Note that I have previously done much the same thing using NSArrayController, without any objects being copied, so I really don't understand why NSDictionaryController would be copying the objects.

Thanks,

Ron Aldrich
Software Architects, Inc.

_______________________________________________

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


  • Follow-Ups:
    • Re: NSDictionaryController copies objects contained in the dictionary it is controlling?
      • From: Ron Lue-Sang <email@hidden>
  • Prev by Date: Re: Window widgets
  • Next by Date: Cocoa / OC exception handling
  • Previous by thread: Re: fullscreen quicktime across multiple monitors
  • Next by thread: Re: NSDictionaryController copies objects contained in the dictionary it is controlling?
  • Index(es):
    • Date
    • Thread