Intermediary checkin, just to mark my place and back up, in case Panther decides...
authorMatthew Judy <mjudy@ithinksw.com>
Sun, 23 Nov 2003 10:35:48 +0000 (10:35 +0000)
committerMatthew Judy <mjudy@ithinksw.com>
Sun, 23 Nov 2003 10:35:48 +0000 (10:35 +0000)
ITCategory-NSArray.h [new file with mode: 0755]
ITCategory-NSArray.m [new file with mode: 0755]
ITFoundation.h
ITFoundation.xcode/project.pbxproj

diff --git a/ITCategory-NSArray.h b/ITCategory-NSArray.h
new file mode 100755 (executable)
index 0000000..e879feb
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ *     ITKit
+ *  ITCategory-NSArray.h
+ *    Category which extends NSArray
+ *
+ *  Original Author : Joseph Spiros <joseph.spiros@ithinksw.com>
+ *   Responsibility : Matt Judy <mjudy@ithinksw.com>
+ *   Responsibility : Joseph Spiros <joseph.spiros@ithinksw.com>
+ *
+ *  Copyright (c) 2002 - 2003 iThink Software.
+ *  All Rights Reserved
+ *
+ */
+
+
+#import <Cocoa/Cocoa.h>
+
+
+@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 (executable)
index 0000000..6303a5f
--- /dev/null
@@ -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
index 760ffb3..c1df7a9 100755 (executable)
@@ -16,3 +16,5 @@
 
 #import <ITFoundation/ITAppleEventCenter.h>
 #import <ITFoundation/ITDebug.h>
+
+#import <ITFoundation/ITCategory-NSArray.h>
\ No newline at end of file
index 0e95858..90daf83 100755 (executable)
@@ -82,6 +82,7 @@
                0867D691FE84028FC02AAC07 = {
                        children = (
                                08FB77AEFE84172EC02AAC07,
+                               2AB93A2C057059DC007E748F,
                                32C88DFF0371C24200C91783,
                                089C1665FE841158C02AAC07,
                                0867D69AFE84028FC02AAC07,
 //102
 //103
 //104
+//2A0
+//2A1
+//2A2
+//2A3
+//2A4
+               2AB93A2C057059DC007E748F = {
+                       children = (
+                               2AB93A3005705A0C007E748F,
+                               2AB93A3105705A0C007E748F,
+                       );
+                       isa = PBXGroup;
+                       name = Categories;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               2AB93A3005705A0C007E748F = {
+                       expectedFileType = sourcecode.c.h;
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       path = "ITCategory-NSArray.h";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               2AB93A3105705A0C007E748F = {
+                       expectedFileType = sourcecode.c.objc;
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       path = "ITCategory-NSArray.m";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               2AB93A3205705A0C007E748F = {
+                       fileRef = 2AB93A3005705A0C007E748F;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               2AB93A3305705A0C007E748F = {
+                       fileRef = 2AB93A3105705A0C007E748F;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+//2A0
+//2A1
+//2A2
+//2A3
+//2A4
 //320
 //321
 //322
                                7CA50B2D054E77950074E1D9,
                                7CA50B31054E77A00074E1D9,
                                3D2D8A13055E07D800F59C27,
+                               2AB93A3205705A0C007E748F,
                        );
                        isa = PBXHeadersBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                                7CA50B2E054E77950074E1D9,
                                7CA50B32054E77A00074E1D9,
                                3D2D8A12055E07D800F59C27,
+                               2AB93A3305705A0C007E748F,
                        );
                        isa = PBXSourcesBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;