"@@:"
, I think?
Since the function must take at least two arguments—
self
and_cmd
, the second and third characters must be “@:” (the first character is the return type).
Question
What is the type signature for a method returning type id, with no args?
Example:
class_addMethod(self, sel, imp, "?????"); <---- Require correct type sig here
Solution
"@@:"
, I think?
Since the function must take at least two arguments—
self
and_cmd
, the second and third characters must be “@:” (the first character is the return type).
OTHER TIPS
Assuming your IMP
looks like
id some_imp(id self, SEL _cmd) {
//return nil;
}
"@@:"
is correct (return an object, take an object and a SEL).
For more type encodings, see the runtime reference.