3

我收到这条消息:

“(空):发送到类 0x3f52e824 的无法识别的选择器”

我尝试过的基本代码:

SEL sel = @selector(applyProperties:toObject:);

NSInvocation* inv = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:sel]];
[inv setTarget:self];
[inv setSelector:sel];
[inv setArgument:params atIndex:0];
[inv setArgument:theObject atIndex:1];

NSOperationQueue* queue = [[NSOperationQueue alloc] init];
NSInvocationOperation* operation = [[NSInvocationOperation alloc] initWithInvocation:inv];
[queue addOperation:operation];

 [queue release];

我可以用这些参数自己调用 (applyProperties:toObject) ......所以我不确定我做错了什么。

4

1 回答 1

4

答案是显而易见的,并且由于阅读速度过快而容易在文档中遗漏。参数 0 和 1 是保留的,所以我通过设置索引 2 和 3 来解决

于 2011-03-11T19:28:42.377 回答