Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
SEL selector = NSSelectorFromString(@"setAuthorizationStatus:forBundleIdentifier:");
NSMethodSignature *methodSignature = [CLLocationManager methodSignatureForSelector:selector];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSignature];
invocation.selector = selector;
CLAuthorizationStatus status = kCLAuthorizationStatusAuthorizedAlways;
NSString *identifier = @"com.test.testapp";
[invocation setArgument:&status atIndex:2];
[invocation setArgument:&identifier atIndex:3];
[invocation invokeWithTarget:[CLLocationManager class]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.