
#import "ArrayAdditions.h"

@implementation NSArray (MapArray)

- (NSArray *)mapSelector:(SEL)aSelector
{
    NSMutableArray *result = [NSMutableArray array];

    int pos, max = [self count];
    for(pos=0; pos<max; pos++){
	id oneItem = 
	    [[self objectAtIndex:pos] performSelector:aSelector];
	if(oneItem==nil){
	    oneItem = [NSNull null];
	}

	[result addObject:oneItem];
    }

    return [NSArray arrayWithArray:result];
}

@end
