有什么方法可以将 void* 转换为 SEL

Is there any way to cast void* to SEL

我正在使用 obj-c 运行时从 NSInvocation 获取 objects 类型和值。而且我不知道如何按照标题说的去做。

这就是我从 NSInvocation 中检索信息的方式 argValue 应该是 void*,指定的索引是 SEL-typed 参数。

[invocation getArgument:argValue atIndex:argIndex];

那么如何投SEL sel = (???)argValue;

尝试遵循代码。

- (void)forwardInvocation:(NSInvocation *)anInvocation {
  NSLog(@"%@", NSStringFromSelector(anInvocation.selector));
  NSLog(@"%@", anInvocation);
}