• 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: Introspecting the current method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Introspecting the current method


  • Subject: Re: Introspecting the current method
  • From: Sherm Pendley <email@hidden>
  • Date: Sun, 18 Apr 2010 21:45:10 -0400

On Sun, Apr 18, 2010 at 8:21 PM, Graham Cox <email@hidden> wrote:
>
> On 19/04/2010, at 10:14 AM, Dave DeLong wrote:
>
>> If I'm inside a method, is there a way to know at runtime whether that method is a class or an instance method?  Currently the only way I though of to do this is to see if "self" is a Class object or not, but I was wondering if there's a more reliable way to determine this.
>
> I might be lacking imagination here, but I can't think of any situation where needing to detect this would make any sense.

Language bridging, perhaps. You can build up a class definition at run
time, with all of its selectors registered to resolve to a single IMP
function. That's how CamelBones registers Perl classes with the ObjC
runtime, with messages sent to Perl methods (both class and instance)
routed through one IMP function.

sherm--

--
Cocoa programming in Perl:
http://www.camelbones.org
_______________________________________________

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

References: 
 >Introspecting the current method (From: Dave DeLong <email@hidden>)
 >Re: Introspecting the current method (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Introspecting the current method
  • Next by Date: Re: Introspecting the current method
  • Previous by thread: Re: Introspecting the current method
  • Next by thread: Re: Introspecting the current method
  • Index(es):
    • Date
    • Thread