class_addMethod 最后一个参数是 type encodings ,用来标识IMP函数实现的返回值与参数,
具体的type encodings 可以参考apple官方提供的 type encodings 对应表:
Code | Meaning |
---|---|
| A |
| An |
| A |
| A
|
| A |
| An |
| An |
| An |
| An |
| An |
| A |
| A |
| A C++ |
| A |
| A character string ( |
| An object (whether statically typed or typed |
| A class object ( |
| A method selector ( |
[array type] | An array |
{name=type...} | A structure |
(name=type...) | A union |
| A bit field of num bits |
| A pointer to type |
| An unknown type (among other things, this code is used for function pointers) |