• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSMutableDictionary crashing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Thanks!!
  • Next by Date: Re: select Button
  • Previous by thread: Re: Break into Debugger...
  • Next by thread: Re: NSMutableDictionary crashing?
  • Index(es):
    • Date
    • Thread