Skip to content

@markd2 /gist:4595129
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#import <Foundation/Foundation.h>
// clang -g -Weverything -framework Foundation -o count count.m
@interface CountTest : NSObject
- (NSUInteger) count; // notice not a @property
@end
@implementation CountTest
// no synthesize, no extra KVC work.
- (NSUInteger) count {
return 23;
}
@end // CountTest
int main (void) {
@autoreleasepool {
CountTest *countTest = [[CountTest alloc] init];
NSNumber *count = [countTest valueForKey: @"count"];
NSLog (@"count is %@", count);
}
return 0;
} // main
#if 0
% clang -g -Weverything -framework Foundation -o count count.m
% ./count
2013-01-22 09:41:15.619 count[21737:303] count is 23
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.