Re: exception in class derived from NSMutableDictionary
Re: exception in class derived from NSMutableDictionary
- Subject: Re: exception in class derived from NSMutableDictionary
- From: Greg Titus <email@hidden>
- Date: Wed, 30 Jul 2003 09:43:21 -0700
On Wednesday, July 30, 2003, at 9:03 AM, Robert G Palmer Jr wrote:
I have a class that I have derived from NSMutableDictionary - solely
for the purpose of being able to add items using a custom method. If
I execute either of the first two pieces of code, they work fine. If
I execute the third, I get an exception on the count method with the
following message:
2003-07-30 11:47:27.964 V360Locator[1766] An uncaught exception was
raised
2003-07-30 11:47:27.965 V360Locator[1766] *** -count only defined for
abstract class. Define -[VideoSensorCollection count]!
2003-07-30 11:47:27.965 V360Locator[1766] *** Uncaught exception:
<NSInvalidArgumentException> *** -count only defined for abstract
class. Define -[VideoSensorCollection count]!
Any help in expanding my understanding of this would be greatly
appreciated.
You need to read up on Class Clusters in the docs. The problem is
exactly what the exception is telling you that it is...
You would need to implement your own -count method. (Also
-objectForKey:, and -setObject:forKey:.)
Also, now that I look at it, would it not make sense to have my
"VideoSensorCollection" simply be a Category on the
NSMutableDictionary class?
Exactly what I would have said, if you hadn't. :-)
Hope this helps,
- Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.