• 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: How to get the name of a method at runtime?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the name of a method at runtime?


  • Subject: Re: How to get the name of a method at runtime?
  • From: Jonathan Dann <email@hidden>
  • Date: Sun, 9 Mar 2008 16:01:41 +0000


I think maybe you missed the existence of _cmd. Both self (this object) and
_cmd (this selector) are passed as implicit arguments to every Objective-C
method.

You can also call __func__ from within a method call, I use this often,

NSLog(@"%p %s",self,__func__); // Thanks James Bucanek

Jon

_______________________________________________

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: 
 >How to get the name of a method at runtime? (From: Stuart Malin <email@hidden>)
 >Re: How to get the name of a method at runtime? (From: "Sherm Pendley" <email@hidden>)

  • Prev by Date: Re: How do I tell if the mouse button is down, independent of view, etc.?
  • Next by Date: Determining why outline view column editing cancels for no apparent reason
  • Previous by thread: Re: How to get the name of a method at runtime?
  • Next by thread: Re: How to get the name of a method at runtime?
  • Index(es):
    • Date
    • Thread