• 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: Ken Thomases <email@hidden>
  • Date: Sun, 18 Apr 2010 21:01:13 -0500

On Apr 18, 2010, at 7:14 PM, 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?

Keep in mind that class methods are just instance methods, where the instance is the class object.  (The class object being an instance of its metaclass.)

So, in a deep sense, there's no distinction between a class method and an instance method.  There's only the receiver object and the message/selector.

Regards,
Ken

_______________________________________________

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

  • Follow-Ups:
    • Re: Introspecting the current method
      • From: Greg Parker <email@hidden>
References: 
 >Introspecting the current method (From: Dave DeLong <email@hidden>)

  • Prev by Date: Re: Zeroing out instance variables
  • Next by Date: Re: How do I get a file reference w/o relying on the path?
  • Previous by thread: Re: Introspecting the current method
  • Next by thread: Re: Introspecting the current method
  • Index(es):
    • Date
    • Thread