• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Checking a method for parameter types via SEL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking a method for parameter types via SEL


  • Subject: Re: Checking a method for parameter types via SEL
  • From: Bill Bumgarner <email@hidden>
  • Date: Mon, 31 Jul 2006 11:49:56 -0700


On Jul 31, 2006, at 11:23 AM, Tommy Nordgren wrote:

Can someone who have been using cocoa long please tell me how to do this?
The signature should be like this:
-(BOOL) aMethod: (id) owner;

What, exactly, are you trying to do?

The Obj-C runtime supports introspection and you can grab the method signature and then rip it apart to deduce parameter and return types. To a degree; you lose with complex C types and certain other parameter types.

I would suggest poking through the source code for one of the various Obj-C bridges to see the full details; PyObjC, F-Script (Smalltalk- esque), RubyCocoa, and CamelBones (Perl-ObjC) all introspect to do cross language method dispatches.

b.bum

_______________________________________________
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


  • Follow-Ups:
    • Re: Checking a method for parameter types via SEL
      • From: Tommy Nordgren <email@hidden>
References: 
 >Checking a method for parameter types via SEL (From: Tommy Nordgren <email@hidden>)

  • Prev by Date: Re: Core Recipes question (Migration)
  • Next by Date: Re: Re: Can I tell which object is retaining my window?
  • Previous by thread: Re: Checking a method for parameter types via SEL
  • Next by thread: Re: Checking a method for parameter types via SEL
  • Index(es):
    • Date
    • Thread