Trapping insert nil value into dictionary?
Trapping insert nil value into dictionary?
- Subject: Trapping insert nil value into dictionary?
- From: "Ben Kennedy" <email@hidden>
- Date: Thu, 16 Oct 2003 21:32:04 -0400
- Organization: Zygoat Creative Technical Services
Greetings all,
One of my users is reporting errors upon launch and new document creation
where the following is being dumped to console:
2003-10-16 18:34:07.488 Doggiebox[1302] *** -[NSCFDictionary
setObject:forKey:]: attempt to insert nil value
The new doc fails, and the app seems to be doing nothing at all
(continues normal run loop, but no untitled doc appears).
Of course, there are about a million places in my code (not to mention
the frameworks) where that method is called. What I want to do is trap
it and at least find out the name of the key whose nil value is being
attempted, or even better, a stack backtrace from the point in question.
If I could reproduce the error, I would simply put a breakpoint on -
[NSException raise] in the debugger. The problem is, I can't; only one
user is reporting this problem, but consistently.
I've read the list archives, which suggest setting a default for
NSExceptionHandlingMask. I've had my user try this, to no avail. Indeed
I've tried it myself, while deliberately doing a nil-value insert; the
behaviour is the same. This is probably because NSApplication is
fielding the exception in the run loop, so it is never going as uncaught.
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?
-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.