[Top][All Lists]

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

Description method in NSImage

From: Lundberg, Johannes
Subject: Description method in NSImage
Date: Thu, 26 Dec 2013 18:13:34 +0900


I noticed that the description method is missing in NSImage.
Here is a patch that adds a description method that will generate an output similar to OS X 10.8.

Useful for debugging with NSLog...

Index: Source/NSImage.m
--- Source/NSImage.m    (revision 37440)
+++ Source/NSImage.m    (working copy)
@@ -461,6 +461,16 @@
   return NO;
+- (NSString*)description
+    return [NSString stringWithFormat: @"<%@ %p Name=%@ Size=%@ Reps=%@>",
+            [self class],
+            self,
+            [self name],
+            NSStringFromSize([self size]),
+            [self representations]];
 /* This methd sets the name of an image, updating the global name dictionary
  * to point to the image (or removing an image from the dictionary if the
  * new name is nil).

Best regards
Johannes Lundberg

CONFIDENTIALITY NOTE: The information in this email is confidential
and intended solely for the addressee.
Disclosure, copying, distribution or any other action of use of this
email by person other than intended recipient, is prohibited.
If you are not the intended recipient and have received this email in
error, please destroy the original message.

Attachment: nsimage-description.patch
Description: Binary data

reply via email to

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