Created
November 20, 2009 04:58
-
-
Save liyanage/239297 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LDFLAGS='-framework Foundation' make test2 && ./test2 | |
#import <Foundation/Foundation.h> | |
@interface Foo : NSObject { | |
NSString *bar; | |
} | |
@property (retain) NSString *bar; | |
@end | |
@implementation Foo | |
@synthesize bar; | |
- (void)dealloc { | |
[bar release]; | |
[super dealloc]; | |
} | |
@end | |
int main (int argc, const char *argv[]) { | |
NSAutoreleasePool *pool = [NSAutoreleasePool new]; | |
Foo *x = [Foo new]; | |
[x setValue:@"test" forKey:@"Bar"]; | |
// [x setValue:@"test" forKey:@"bar"]; | |
NSLog(@"%@", [x valueForKey:@"bar"]); | |
// NSLog(@"%@", [x valueForKey:@"Bar"]); | |
[pool release]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment