On 23 Sep 2010, at 16:45, Matt Neuburg wrote:

> Is there a cool dynamic Cocoa way to call super with the same parameters
> that came to me? I guess what I'm looking for is a pre-configured invocation
> of the current command where I can just change the target to super. No big
> deal, but I just wondered, since Cocoa is cool and dynamic. m.

No, but you can easily write an NSProxy subclass that doesn't invoke the 
method, but returns you the runtime-generated NSInvocation by reference. i.e

NSInvocation *invocation;
[[object invocationProxy:&invocation] 
do:thing:with:any:number:of:args:you:want:];

Then get the objc_super struct using the invocation's target and its class and 
use libffi (http://sourceware.org/libffi/) to construct the argument list from 
the invocation and call objc_msgSendSuper() yourself.

Maybe.

I've not done the latter part, but I'm sure it would be possible. I feel a 
weekend project coming on.

Jonathan_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to