NSInvocation driving me nuts
NSInvocation driving me nuts
- Subject: NSInvocation driving me nuts
- From: Pierre Bernard <email@hidden>
- Date: Sat, 8 Apr 2006 13:24:50 +0200
Can you spot the difference between:
[delegate _managedObjectContextEditor:self
didCommit:YES
contextInfo:contextInfo];
and this:
SEL selector = @selector
(_managedObjectContextEditor:didCommit:contextInfo:);
NSInvocation *invocation = [NSInvocation
invocationWithMethodSignature:[delegate
methodSignatureForSelector:selector]];
BOOL success = YES;
[invocation setTarget:delegate]; // 0
[invocation setSelector:selector]; // 1
[invocation setArgument:&self atIndex:2];
[invocation setArgument:&success atIndex:3];
[invocation setArgument:&contextInfo atIndex:4];
[invocation retainArguments];
[invocation invoke];
[invocation release];
Well, the first one works. The second does not!
TIA for your help
Pierre
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden