【发布时间】:2016-08-22 14:17:35
【问题描述】:
我正在使用 obj-c 运行时从 NSInvocation 获取对象类型和值。而且我不知道该怎么做。
这就是我从 NSInvocation 检索信息的方式 argValue 应该是 void*,指定的索引是 SEL 类型的参数。
[invocation getArgument:argValue atIndex:argIndex];
那么SEL sel = (???)argValue;怎么投呢?
【问题讨论】:
-
你试过
(SEL)argValue吗? -
@Cy-4AH,感谢您的回答找到:
SEL value = nil; [invocation getArgument:&value atIndex:index];
标签: objective-c objective-c-runtime