public
Created

  • Download Gist
gistfile1.txt
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
#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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.