2011-02-08 5 views
3
나는이 메시지를 받고 있어요

:있는 NSInvocation :이 설정되어 있지만 인식 할 수없는 선택

"(널) : 인식 할 수없는 선택기 클래스 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)를 호출 할 수 있습니다 ... 그래서 내가 뭘 잘못하고 있는지 잘 모르겠습니다.

+0

이 코드는 인스턴스 또는 클래스 메서드 내에 있습니까? –

+0

@jacob 인스턴스 내에 있습니다. – michael

+0

은'applyProperties : toObject :'인스턴스 메소드입니까? –

답변

3

대답은 분명하며 문서 읽기에 너무 빨리 빠지기 쉽습니다. 인수 0과 1은 예약되어 있으므로 인덱스 2와 3으로 설정하여 해결했습니다.

관련 문제