gnustep-dev
[Top][All Lists]
Advanced

[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

Hi

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
BRILLIANTSERVICE CO., LTD.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
秘密保持について:この電子メールは、名宛人に送信したものであり、秘匿特権の対象となる情報を含んでいます。
もし、名宛人以外の方が受信された場合、このメールの破棄、およびこのメールに関する一切の開示、
複写、配布、その他の利用、または記載内容に基づくいかなる行動もされないようお願い申し上げます。
---
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]