Re: Trapping insert nil value into dictionary?
Re: Trapping insert nil value into dictionary?
- Subject: Re: Trapping insert nil value into dictionary?
- From: Scott Anguish <email@hidden>
- Date: Fri, 17 Oct 2003 02:05:33 -0400
On Oct 17, 2003, at 12:59 AM, Ben Kennedy wrote:
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).
NSCFDictionary isn't a public class.. it's part of the NSDictionary
class cluster.
If I had to make a guess, I'd say that they've got something messed up
in their preferences for the app, or in some settings they're
attempting to load.. do you store anything in Application Support?
So, if you get them to send those to you, you should be in better
shape to find the problem.. The best way to find this is to run under
GDB...
If not, are there crash logs on the client's machine? I think it'll
depend on the version of the OS they're running.
And you may do this in many places in your code, but most of those
aren't probably being called before the crash occurs, so you should be
able to narrow it down further.
_______________________________________________
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.