Provides type information about method arguments and return values. Supports MetaABI and method frame layout.
NSObject
uint32_t _bits; // Method descriptor bits
uint16_t _count; // Number of types
uint16_t _extra; // Extra storage size
char *_types; // Type encodings
MulleObjCMethodSignatureTypeInfo *_infos; // Type information
+signatureWithObjCTypes:
- Creates signature from type string+_signatureWithObjCTypes:descriptorBits:
- Internal creation method-isOneway
- Checks if method is oneway-isVariadic
- Checks if method has variable arguments-_descriptorBits
- Gets method descriptor bits-frameLength
- Gets frame storage length-mulleMetaABIFrameLength
- Gets MetaABI frame length-methodReturnLength
- Gets return value size-methodReturnType
- Gets return value type-getArgumentTypeAtIndex:
- Gets argument type at index-numberOfArguments
- Gets total argument count-mulleSignatureTypeInfoAtIndex:
- Gets type info at index-_methodMetaABIReturnType
- Gets MetaABI return type-_methodMetaABIParameterType
- Gets MetaABI parameter type-mulleInvocationSize
- Gets required invocation storage size// Get method signature
NSMethodSignature *sig = [target methodSignatureForSelector:@selector(method:)];
// Check argument count
NSUInteger args = [sig numberOfArguments]; // Includes self and _cmd
// Get argument types
char *type = [sig getArgumentTypeAtIndex:2]; // First user argument
// Get return type
char *returnType = [sig methodReturnType];
// Check method properties
BOOL isOneway = [sig isOneway];
BOOL hasVarArgs = [sig isVariadic];
// Get sizes for allocation
NSUInteger frameSize = [sig frameLength];
NSUInteger metaABISize = [sig mulleMetaABIFrameLength];
typedef enum {
MulleObjCMetaABITypeVoid = 0,
MulleObjCMetaABITypeVoidPointer = 1,
MulleObjCMetaABITypeParameterBlock = 2
} MulleObjCMetaABIType;