discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Logging NSData


From: Ivan Vučica
Subject: Re: Logging NSData
Date: Thu, 21 Jul 2011 20:59:50 +0200

Could it be preferring -localizedDescription? Is -localizedDescription also 
implemented? Just guessing here.

On 21. srp. 2011., at 19:15, Andreas Höschler wrote:

> Hi all,
> 
> I am logging out NSDictionaries that sometimes contain NSData instances as 
> values. On MacOSX NSData::description is called to determine a string that is 
> used in the output. I don't want to see tons of hex values for large NSData 
> objects in the output and therefore wrote the following category:
> 
> @implementation NSData (SRDataExtension)
> 
> - (NSString *)description
> {
>   return [NSString stringWithFormat:@"<data of length %d>", [self length]];
> }
> 
> @end
> 
> This works great on MacOSX but not under GNUstep. It seems that description 
> is not called under GNUstep when a dictionary is logged out with
> 
>       NSLog(@"dic %@", dic);
> 
> Any idea?
> 
> Thanks a lot!
> 
>   Andreas
> 
> 
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep

--
Ivan Vučica
ivan@vucica.net - http://ivan.vucica.net/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]