//
// main.m
// Ex15
//
// Created by Richard Heffren on 11-11-30.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#define intig(x) [NSNumber numberWithInt:(x)]
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *nums = [[NSArray alloc] initWithObjects:
intig(1), intig(1), intig(1), intig(2), intig(3), intig(3), nil];
NSCountedSet *freq = [[NSCountedSet alloc] initWithArray: nums];
NSEnumerator *enumerator = [freq objectEnumerator];
id object;
while (object = [enumerator nextObject]) {
NSLog(@"%@ was added %lu times", object, [freq countForObject: object]);
}
[nums release];
[freq release];
[pool drain];
return 0;
}