Skip to content

Instantly share code, notes, and snippets.

@tanb
Last active December 20, 2015 13:29
Show Gist options
  • Save tanb/6139305 to your computer and use it in GitHub Desktop.
Save tanb/6139305 to your computer and use it in GitHub Desktop.
NSInteger column = 2;
SEL sel = NSSelectorFromString(@"numberOfRowsInColumn:");
NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[datePickerView methodSignatureForSelector:sel]];
[inv setSelector:sel];
[inv setTarget:datePickerView];
[inv setArgument:&column atIndex:2];
[inv invoke];
NSUInteger length = [[inv methodSignature] methodReturnLength];
NSInteger buffer = (NSInteger)malloc(length);
[inv getReturnValue:&buffer];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment