1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@interface Foo : NSObject
@property int bar;
@end

@implementation Foo
@synthesize bar;
@end



int main (int argc, const char * argv[]) {
    NSAutoreleasePool *pool = [NSAutoreleasePool new];
	
	Foo * f = [[Foo alloc] init];
	NSLog(@"before: %d", [f bar]);
	[f setValue:[NSNumber numberWithInt:42] forKey:@"bar"];
	NSLog(@"after: %d", [f bar]);
	[f release];
	[pool release];
}

/** Logs:
2010-07-17 21:23:05.756 EmptyFoundation[80500:a0f] before: 0
2010-07-17 21:23:05.774 EmptyFoundation[80500:a0f] after: 42
**/