NSDictionaryController copies objects contained in the dictionary it is controlling?
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