Re: Trapping insert nil value into dictionary?
Re: Trapping insert nil value into dictionary?
- Subject: Re: Trapping insert nil value into dictionary?
- From: Ambroise Confetti <email@hidden>
- Date: Fri, 17 Oct 2003 03:53:15 +0200
Le vendredi, 17 oct 2003, ` 03:32 Europe/Paris, Ben Kennedy a icrit :
2003-10-16 18:34:07.488 Doggiebox[1302] *** -[NSCFDictionary
setObject:forKey:]: attempt to insert nil value
[...]
I feel like my hands are tied here, yet this seems a conceptually very
simple problem to solve, and must come up reasonably often for other
developers. How can I deal with this, to get more information about
the
context of the exception?
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]];
Of course, this is quite dirty and I would never do it in a final
product, but it might help track the bug.
Hope this helps...
Ambroise
http://www.cellulo.info/
_______________________________________________
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.