Re: get class of a method

2015-02-23 Thread Alex Zavatone
In that case, all I can think of is parsing all the project the .m files, finding the method implementation and storing what string is declared within the parens. Build the table before compilation or at, store it in plists for each class and read the plist for each class to determine the expec

Re: get class of a method

2015-02-23 Thread Alex Zavatone
I'm surely speaking from ignorance here, but could one extend the runtime to store a table (NSSet?) of class methods and then at an appropriate event, either parse all the source (lame, I know) or access a class method table from the runtime? Check out "Name angling in Objective-C" on Wikipedia

Re: get class of a method

2015-02-22 Thread Kyle Sluder
On Mon, Feb 23, 2015, at 12:18 AM, Maxthon Chan wrote: > In Objective-C, methods are called my sending messages, and message > selectors are not bounded to a class. > > You can walk all loaded classes and try to work out the classes that > responds to the message selector in question, but beware c

Re: get class of a method

2015-02-22 Thread Maxthon Chan
In Objective-C, methods are called my sending messages, and message selectors are not bounded to a class. You can walk all loaded classes and try to work out the classes that responds to the message selector in question, but beware classes that descended from the old Object class (not NSObject

Re: get class of a method

2015-02-22 Thread Ken Thomases
On Feb 22, 2015, at 3:01 PM, Jack Brindle wrote: > Doesn’t [self class] do this? The method is within whatever self is, so it > seems appropriate that [self class] > would provide what you want. Although the subject wasn't clear, the body makes it clear he's looking for the return type of a me

Re: get class of a method

2015-02-22 Thread Alex Zavatone
That's the class of the current instance. I think the poster wants this: "I have this method. What's its class?" On Feb 22, 2015, at 4:01 PM, Jack Brindle wrote: > Doesn’t [self class] do this? The method is within whatever self is, so it > seems appropriate that [self class] > would provide

Re: get class of a method

2015-02-22 Thread Jack Brindle
Doesn’t [self class] do this? The method is within whatever self is, so it seems appropriate that [self class] would provide what you want. - Jack > On Feb 22, 2015, at 4:41 AM, BareFeetWare > wrote: > > Hi all, > > How can I get the class of a method, at runtime? > > I can get the name of

Re: get class of a method

2015-02-22 Thread Kyle Sluder
On Sun, Feb 22, 2015, at 12:11 PM, Jens Alfke wrote: > > > On Feb 22, 2015, at 9:30 AM, Kyle Sluder wrote: > > > > The compiler does keep type info for properties, but that’s not actually > > documented. > > It’s documented in the “Declared Properties” section of the “Objective-C > Runtime Pro

Re: get class of a method

2015-02-22 Thread Jens Alfke
> On Feb 22, 2015, at 9:30 AM, Kyle Sluder wrote: > > The compiler does keep type info for properties, but that’s not actually > documented. It’s documented in the “Declared Properties” section of the “Objective-C Runtime Programming Guide”: You can use the property_getAttributes fun

Re: get class of a method

2015-02-22 Thread Kyle Sluder
> On Feb 22, 2015, at 4:41 AM, BareFeetWare > wrote: > > However, the returnType is just a char that is set to "@" for all classes. I > want to know which class is returned. The compiler does not preserve this information. It also does not preserve the static types of method arguments. The c

get class of a method

2015-02-22 Thread BareFeetWare
Hi all, How can I get the class of a method, at runtime? I can get the name of the class methods via: Method *methods = class_copyMethodList(objc_getMetaClass([NSStringFromClass([self class]) UTF8String]), &methodCount); for (int i = 0; i < methodCount; i++) { Method method = m