Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!hellgate.utah.edu!helios.ee.lbl.gov!lbl-csam.arpa!stefan From: stefan@lbl-csam.arpa (Stefan gottschalk) Newsgroups: comp.sys.next Subject: function which returns a list of object's methods Message-ID: <3897@helios.ee.lbl.gov> Date: 4 Oct 89 02:28:11 GMT Sender: usenet@helios.ee.lbl.gov Followup-To: comp.sys.next Distribution: na Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 24 I am interested in finding (or writing myself) a method which will return a list of an object's known methods. I know about the respondsTo: method, which allows one to ask whether the queried object has a *particular* method, which takes a method as a parameter and returns a boolean indicating whether the object knows the method. I also know about the run-time functions in "Chapter 23: C Functions" in the NeXT online documentation. The function objc_getClasses() returns a table of the classes present in the "executable image", which resembles what I need. I have in mind a function called (for example) objc_getMethods(), where you pass in an object and get back a table of strings or selectors. Does anyone know if such a function exists, and if not, how such a function could be built from the existing libraries? I intend to append the method to the Object class (via categories). The idea is to put all the work into this method, so that I won't have to think about it as I design new classes (they should simply inherit the ability to return message lists). I would appreciate any ideas at all. Thanks in advance! Stefan Gottschalk (stefan@csam.lbl.gov)