#import <objc/objc.h>
#import <objc/Object.h>

static int count;

@interface foo: Object
+(int) initCount;
+(void) initialize;
@end


@implementation foo
-(id) init {
    self = [super init];
    count++;
    return self;
}

+(int) initCount {
    return count;
}

+(void) initialize {
    count = 0;
}

int main( int argc, const char *argv[] ) {
    foo *c1 = [[foo alloc] init];
    foo *c2 = [[foo alloc] init];

    // print count
    printf( "foo count: %i\n", [foo initCount] );
    
    foo *c3 = [[foo alloc] init];

    // print count again
    printf( "foo count: %i\n", [foo initCount] );
    
    return 0;
}
@end