From a562b4a9e91163116b73f2df7d6589d812d2278e Mon Sep 17 00:00:00 2001 From: Joseph Spiros Date: Sat, 26 Feb 2005 06:16:19 +0000 Subject: [PATCH] Adding a category to NSProxy that fixes a bug so as to allow NSProxies to be passed as arguments to NSLog without needing to explicitly call -description outside of NSLog. --- ITCategory-NSProxy.h | 22 +++++++++++++++++++ ITCategory-NSProxy.m | 9 ++++++++ ITFoundation.xcode/project.pbxproj | 35 ++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 ITCategory-NSProxy.h create mode 100644 ITCategory-NSProxy.m diff --git a/ITCategory-NSProxy.h b/ITCategory-NSProxy.h new file mode 100644 index 0000000..6848d14 --- /dev/null +++ b/ITCategory-NSProxy.h @@ -0,0 +1,22 @@ +/* + * ITFoundation + * ITCategory-NSProxy.h + * + * This is actually a bug fix, as _copyDescription is required by NSLog when + * you supply an object other than a string as a parameter for building a + * string, and yet NSProxy does not implement or proxy it. + * + * Copyright (c) 2005 by iThink Software. + * All Rights Reserved. + * + * $Id$ + * + */ + +#import + +@interface NSProxy (ITCategory) + +- (NSString *)_copyDescription; + +@end diff --git a/ITCategory-NSProxy.m b/ITCategory-NSProxy.m new file mode 100644 index 0000000..e4f73c4 --- /dev/null +++ b/ITCategory-NSProxy.m @@ -0,0 +1,9 @@ +#import "ITCategory-NSProxy.h" + +@implementation NSProxy (ITCategory) + +- (NSString *)_copyDescription { + return [[self description] retain]; +} + +@end diff --git a/ITFoundation.xcode/project.pbxproj b/ITFoundation.xcode/project.pbxproj index f32054d..64c152b 100755 --- a/ITFoundation.xcode/project.pbxproj +++ b/ITFoundation.xcode/project.pbxproj @@ -210,6 +210,8 @@ //2A4 2AB93A2C057059DC007E748F = { children = ( + 7CB02EB407D049BB00959EA0, + 7CB02EB507D049BB00959EA0, 7C2D93BD07C2FD6700A487A9, 7C2D93BE07C2FD6700A487A9, 7C058DF7072F10530082E1E9, @@ -814,6 +816,37 @@ ); }; }; + 7CB02EB407D049BB00959EA0 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = "ITCategory-NSProxy.h"; + refType = 4; + sourceTree = ""; + }; + 7CB02EB507D049BB00959EA0 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = "ITCategory-NSProxy.m"; + refType = 4; + sourceTree = ""; + }; + 7CB02EB607D049BB00959EA0 = { + fileRef = 7CB02EB407D049BB00959EA0; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + Public, + ); + }; + }; + 7CB02EB707D049BB00959EA0 = { + fileRef = 7CB02EB507D049BB00959EA0; + isa = PBXBuildFile; + settings = { + }; + }; 7CF6C92E057D65B0007FEC13 = { fileEncoding = 4; isa = PBXFileReference; @@ -941,6 +974,7 @@ 376AF4DF06597CA900F0979E, 7C058DF9072F10530082E1E9, 7C2D93BF07C2FD6700A487A9, + 7CB02EB607D049BB00959EA0, ); isa = PBXHeadersBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -981,6 +1015,7 @@ 376AF4E006597CA900F0979E, 7C058DFA072F10530082E1E9, 7C2D93C007C2FD6700A487A9, + 7CB02EB707D049BB00959EA0, ); isa = PBXSourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; -- 2.20.1