Sending messages to Objective C objects at runtime
Sending messages to Objective C objects at runtime
- Subject: Sending messages to Objective C objects at runtime
- From: Vincent Coetzee <email@hidden>
- Date: Sun, 1 Feb 2004 09:57:04 +0200
Hi there
This may be a dumb question, I am not sure, and in my assembler days I
may have known the answer, so please excuse me up front if it IS
stupid. I need to invoke an operation on an Objective C Object from
within C code. The selector is not known in advance and neither are the
types or number of arguments. When initially considering this problem I
thought it was easy I saw that there were C functions to send messages
to Objective C objects. The problem is that the objc_msgSend is typed
as
id objc_msgSend(id receiver, SEL selector,...)
My problem is how do I dynamically create a va_args, so that I can use
this function and push the appropriate arguments onto the stack. I
suppose an alternative mechanism would be to use NSInvocation, but that
looks frightfully HEAVY. Does anyone know how to fiddle va_args in
Objective C, or am I missing something really obvious.
Thanks in advance
Vincent
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.