performSelector with arglist_t - C

This is a discussion on performSelector with arglist_t - C ; Hello, I found that GNU Objective-C has the performSelector with a arglist_t which allow to pass a variable number of arguments to performSelector, but NSObject have only one version without arguments, another with one id, and another with two id. ...

+ Reply to Thread
Results 1 to 3 of 3

performSelector with arglist_t

  1. Default performSelector with arglist_t

    Hello, I found that GNU Objective-C has the performSelector with a arglist_t which allow to pass a variable number of arguments to performSelector, but NSObject have only one version without arguments, another with one id, and another with two id.

    How can I pass a method, for instance, three arguments? And how can I pass a parameter which is not a 32 bits value?

    Greeting: Fernando

  2. Default Re: performSelector with arglist_t

    Fernando <trash@yahoo.com> writes:

    > Hello, I found that GNU Objective-C has the performSelector with a
    > arglist_t which allow to pass a variable number of arguments to
    > performSelector, but NSObject have only one version without arguments,
    > another with one id, and another with two id.
    >
    > How can I pass a method, for instance, three arguments? And how can I
    > pass a parameter which is not a 32 bits value?


    Have a look at NSInvocation.

    sherm--

    --
    Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    Cocoa programming in Perl: http://camelbones.sourceforge.net

  3. Default Re: performSelector with arglist_t

    Fernando <trash@yahoo.com> wrote:
    > Hello, I found that GNU Objective-C has the performSelector with a
    > arglist_t which allow to pass a variable number of arguments to
    > performSelector, but NSObject have only one version without arguments,
    > another with one id, and another with two id.
    >
    > How can I pass a method, for instance, three arguments? And how can I
    > pass a parameter which is not a 32 bits value?


    This second question is misleading: it is not safe to pass arbitrary
    32-bit values through performSelector:. You must only pass objects.

    The answer is to call objc_msgSend() directly. It's a bit ugly but not
    difficult in the least.

    --
    Michael Ash
    Rogue Amoeba Software

+ Reply to Thread

Similar Threads

  1. add more args to performSelector:withObjct...
    By Application Development in forum C
    Replies: 1
    Last Post: 10-10-2007, 09:48 AM
  2. return type of -performSelector:
    By Application Development in forum C
    Replies: 10
    Last Post: 10-21-2006, 04:50 AM
  3. Can't get performSelector:withObject: working
    By Application Development in forum C
    Replies: 6
    Last Post: 06-06-2006, 06:03 AM