Re: "-forwardInvocation:" like NSInvocation creation
Re: "-forwardInvocation:" like NSInvocation creation
- Subject: Re: "-forwardInvocation:" like NSInvocation creation
- From: Jerry Krinock <email@hidden>
- Date: Mon, 29 Mar 2010 12:31:31 -0700
On 2010 Mar 29, at 12:06, Philip Mötteli wrote:
> I never said, it's not possible. But it's a huge task to re-implement a general method like this. If you understand, that you have to treat every different argument type dynamically.
Maybe I don't understand, but a couple years ago I wrote this little method that creates an invocation in one line of code
+ (NSInvocation*)invocationWithTarget:(id)target
selector:(SEL)selector
retainArguments:(BOOL)retainArguments
argumentAddresses:(void*)firstArgumentAddress, ... ;
It handles all argument types, using varargs and the method signature of the selector. I'll post the code if you're interested.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden