1 #import "ITCategory-NSArray.h"
4 @implementation NSArray (ITCategory)
6 - (NSArray *)objectsForKey:(NSString *)key
8 NSMutableArray *array = [[[NSMutableArray alloc] initWithCapacity:[self count]] autorelease];
9 NSEnumerator *enumerator = [self objectEnumerator];
12 while ( (anItem = [enumerator nextObject]) ) {
14 id itemObject = [anItem objectForKey:key];
17 [array addObject:itemObject];
19 [array addObject:[NSNull null]];
26 - (BOOL)containsString:(NSString *)string
28 NSEnumerator *enumerator = [self objectEnumerator];
32 while ( (anItem = [enumerator nextObject]) ) {
34 if ( ([[anItem class] isEqual:[NSString class]]) && [anItem isEqualToString:string] ) {