NSMutableDictionary crashing?
NSMutableDictionary crashing?
- Subject: NSMutableDictionary crashing?
- From: Alex Rice <email@hidden>
- Date: Wed, 1 Jan 2003 15:01:59 -0700
I discovered this while trying to use a parent-child relationship in a
NSMutableDictionary using property list serialization. After reading up
on Archiving vs Serialization I know that's not going to work. However,
aside from serialization, is it safe to use any parent-child
relationships in NSDictionary? Calling - description in this example
results in a crash:
NSMutableDictionary *child = [NSMutableDictionary
dictionaryWithCapacity: 1];
NSMutableDictionary *parent = [NSMutableDictionary
dictionaryWithCapacity: 1];
[parent setObject: child forKey: @"child"];
[child setObject: parent forKey: @"parent"];
NSLog(@"parent description = %@", [parent description]);
crashes with stack trace:
#6 0x907f94e8 in -[NSArray initWithArray:copyItems:]
#7 0x90804188 in +[NSArray arrayWithArray:copyItems:]
#8 0x908192a8 in -[NSArray sortedArrayUsingFunction:context:]
#9 0x9080d6f8 in -[NSDictionary descriptionWithLocale:indent:]
(#9 infinitely)
Possibly related to this, I am trying to debug some code that crashes
when I call
[anArray indexOfObject: aMutableDictionary];
I get the exception
*** -count sent to an uninitialized mutable dictionary object
Is it possible that indexOfObject: calls -description on the object at
some point? In that situation I am getting this exception:
TIA
Alex Rice <email@hidden> | Mindlube Software |
http://mindlube.com
what a waste of thumbs that are opposable
to make machines that are disposable Ani DiFranco
_______________________________________________
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.