Re: NSLog and [NSDictionary description], bug?
Re: NSLog and [NSDictionary description], bug?
- Subject: Re: NSLog and [NSDictionary description], bug?
- From: Ondra Cada <email@hidden>
- Date: Tue, 6 Apr 2004 13:13:47 +0200
Stiphane,
On Tuesday, Apr 6, 2004, at 12:49 Europe/Prague, Stiphane Sudre wrote:
NSLog([myDictionary description]);
where myDictionary is a NSDictionary.
With some dictionaries, it crashes.
With which ones?
In my experience, NSDictionaries alas do not support cycles properly
anymore (well, *unless my memory plays tricks on me*, they did in
OpenStep). Anyway, as soon as an NSDictionary contains a loop, any
description or NSLog or even po in gdb tends to crash for me :(((
122 /tmp> <q.m
#import <Foundation/Foundation.h>
int main() {
[NSAutoreleasePool new];
id md=[NSMutableDictionary dictionary];
[md setObject:md forKey:@"whatever"];
NSLog(@"%@",md);
return 0;
}
123 /tmp> cc -Wall -framework Foundation q.m && ./a.out
zsh: segmentation fault ./a.out
124 /tmp>
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.