From dda524c432a0448c25815e4b5ac04a5c8a6f3813 Mon Sep 17 00:00:00 2001 From: Matthew Judy Date: Sun, 23 Nov 2003 10:35:48 +0000 Subject: [PATCH] Intermediary checkin, just to mark my place and back up, in case Panther decides to be an ass again. --- ITCategory-NSArray.h | 25 ++++++++++++++ ITCategory-NSArray.m | 42 +++++++++++++++++++++++ ITFoundation.h | 2 ++ ITFoundation.xcode/project.pbxproj | 54 ++++++++++++++++++++++++++++++ 4 files changed, 123 insertions(+) create mode 100755 ITCategory-NSArray.h create mode 100755 ITCategory-NSArray.m diff --git a/ITCategory-NSArray.h b/ITCategory-NSArray.h new file mode 100755 index 0000000..e879feb --- /dev/null +++ b/ITCategory-NSArray.h @@ -0,0 +1,25 @@ +/* + * ITKit + * ITCategory-NSArray.h + * Category which extends NSArray + * + * Original Author : Joseph Spiros + * Responsibility : Matt Judy + * Responsibility : Joseph Spiros + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ + + +#import + + +@interface NSArray (ITCategory) + +- (NSArray *)objectsForKey:(NSString *)key; +- (BOOL)containsString:(NSString *)string; + + +@end diff --git a/ITCategory-NSArray.m b/ITCategory-NSArray.m new file mode 100755 index 0000000..6303a5f --- /dev/null +++ b/ITCategory-NSArray.m @@ -0,0 +1,42 @@ +#import "ITCategory-NSArray.h" + + +@implementation NSArray (ITCategory) + +- (NSArray *)objectsForKey:(NSString *)key +{ + NSMutableArray *array = [[[NSMutableArray alloc] initWithCapacity:[self count]] autorelease]; + NSEnumerator *enumerator = [self objectEnumerator]; + id anItem; + + while ( (anItem = [enumerator nextObject]) ) { + + id itemObject = [anItem objectForKey:key]; + + if ( itemObject ) { + [array addObject:itemObject]; + } else { + [array addObject:[NSNull null]]; + } + } + + return array; +} + +- (BOOL)containsString:(NSString *)string +{ + NSEnumerator *enumerator = [self objectEnumerator]; + id anItem; + BOOL result = NO; + + while ( (anItem = [enumerator nextObject]) ) { + + if ( ([[anItem class] isEqual:[NSString class]]) && [anItem isEqualToString:string] ) { + result = YES; + } + } + + return result; +} + +@end diff --git a/ITFoundation.h b/ITFoundation.h index 760ffb3..c1df7a9 100755 --- a/ITFoundation.h +++ b/ITFoundation.h @@ -16,3 +16,5 @@ #import #import + +#import \ No newline at end of file diff --git a/ITFoundation.xcode/project.pbxproj b/ITFoundation.xcode/project.pbxproj index 0e95858..90daf83 100755 --- a/ITFoundation.xcode/project.pbxproj +++ b/ITFoundation.xcode/project.pbxproj @@ -82,6 +82,7 @@ 0867D691FE84028FC02AAC07 = { children = ( 08FB77AEFE84172EC02AAC07, + 2AB93A2C057059DC007E748F, 32C88DFF0371C24200C91783, 089C1665FE841158C02AAC07, 0867D69AFE84028FC02AAC07, @@ -208,6 +209,57 @@ //102 //103 //104 +//2A0 +//2A1 +//2A2 +//2A3 +//2A4 + 2AB93A2C057059DC007E748F = { + children = ( + 2AB93A3005705A0C007E748F, + 2AB93A3105705A0C007E748F, + ); + isa = PBXGroup; + name = Categories; + refType = 4; + sourceTree = ""; + }; + 2AB93A3005705A0C007E748F = { + expectedFileType = sourcecode.c.h; + fileEncoding = 4; + isa = PBXFileReference; + path = "ITCategory-NSArray.h"; + refType = 4; + sourceTree = ""; + }; + 2AB93A3105705A0C007E748F = { + expectedFileType = sourcecode.c.objc; + fileEncoding = 4; + isa = PBXFileReference; + path = "ITCategory-NSArray.m"; + refType = 4; + sourceTree = ""; + }; + 2AB93A3205705A0C007E748F = { + fileRef = 2AB93A3005705A0C007E748F; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + Public, + ); + }; + }; + 2AB93A3305705A0C007E748F = { + fileRef = 2AB93A3105705A0C007E748F; + isa = PBXBuildFile; + settings = { + }; + }; +//2A0 +//2A1 +//2A2 +//2A3 +//2A4 //320 //321 //322 @@ -467,6 +519,7 @@ 7CA50B2D054E77950074E1D9, 7CA50B31054E77A00074E1D9, 3D2D8A13055E07D800F59C27, + 2AB93A3205705A0C007E748F, ); isa = PBXHeadersBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -497,6 +550,7 @@ 7CA50B2E054E77950074E1D9, 7CA50B32054E77A00074E1D9, 3D2D8A12055E07D800F59C27, + 2AB93A3305705A0C007E748F, ); isa = PBXSourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; -- 2.20.1