Re: Trapping insert nil value into dictionary?
Re: Trapping insert nil value into dictionary?
- Subject: Re: Trapping insert nil value into dictionary?
- From: "Ben Kennedy" <email@hidden>
- Date: Fri, 17 Oct 2003 00:59:19 -0400
- Organization: Zygoat Creative Technical Services
On 17 10 2003 at 9:53 pm -0400, Ambroise Confetti wrote:
>
I've never tried it myself, but you could use +[NSObject poseAsClass:].
>
Make a subclass of NSCFDictionary that overrides setObject:forKey: and
>
goes through a piece of code only if the object argument is nil (then
>
you can break there), and as early as possible in you application's
>
code, add
>
>
[[MyNSCFDictionarySubclass class] poseAsClass:[NSCFDictionary class]];
Thanks for the idea Ambroise. However, I'm having trouble doing this...
because I can't find a definition of NSCFDictionary anywhere. PB of
course complains, because it won't let me subclass what it doesn't know about.
I've grepped /System/Library and /Library for NSCFDictionary and no .h
files are found.
I've tried subclassing NSMutableDictionary for the hell of it, and as I
expected, nothing happens (it's not the same class, obviously).
-ben
--
Ben Kennedy, chief magician
zygoat creative technical services
613-228-3392 | 1-866-466-4628
http://www.zygoat.ca
_______________________________________________
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.