1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| Objective-C Runtime 是 Objective-C 的运行时系统,它提供了一系列的 API 和函数, 用于在运行时动态地操作类和对象、调用方法、处理消息等。 以下是一些常用的 Objective-C Runtime API:
类与对象操作: objc_allocateClassPair objc_registerClassPair objc_disposeClassPair objc_getClass objc_getMetaClass objc_getClassList class_getName class_getSuperclass class_getMethodImplementation object_getClass object_setClass object_getClassName objc_enumerationMutation
方法操作 class_copyMethodList class_addMethod class_replaceMethod method_getName method_getImplementation method_getTypeEncoding method_setImplementation method_exchangeImplementations
成员变量操作 class_copyIvarList ivar_getName ivar_getTypeEncoding ivar_getOffset
属性操作: class_copyPropertyList property_getName property_getAttributes property_getMethod property_copyAttributeValue property_copyAttributeList
协议操作: objc_getProtocol objc_copyProtocolList protocol_getName protocol_copyMethodDescriptionList protocol_copyPropertyList protocol_copyProtocolLis
消息传递: objc_msgSend objc_msgSendSuper objc_msgSend_stret objc_msgSendSuper_stret
消息转发: resolveInstanceMethod: resolveClassMethod: forwardInvocation: methodSignatureForSelector: doesNotRecognizeSelector:
其他功能: sel_registerName sel_getName sel_isEqual IMP
以上是一些常用的 Objective-C Runtime API,它们提供了丰富的功能, 使得开发者可以在运行时动态地操作类和对象、调用方法、处理消息等, 为 Objective-C 的动态特性提供了支持。
|