The Objective-C runtime is a runtime support library provided with an implementation of the Objective-C language. Its API allows dynamically creating and configuring classes at runtime, as well as introspecting existing classes, methods, properties, and method implementations.
Use this tag for questions that involve interacting with the Objective-C runtime. This includes fundamental methods of NSObject
, <NSObject>
, and NSProxy
, as well as the API exposed by the files in <objc/>
such as <objc/objc-runtime.h>
.
Very few Objective-C development tasks require interacting with the runtime:
- Introspecting the runtime environment, for example to produce a live class browser or graph the relationships between classes or objects at runtime.
- Creating a proxy object to interact with the message forwarding machinery.
- Dynamically creating classes and methods at runtime, for example, to support a scripting interface.
- Optimization hacks for repeated message sends, such as hoisting the method lookup out of the loop and calling the implementing function directly.
- Writing an application without using objective-c, such as C or C++
Many of these topics have been thoroughly addressed in blog form by Mike Ash in his Friday Q&A series of blog posts.
Related tags that might be more appropriate for your question:
- Use objective-c for questions about the language rather than its runtime, including problems with reference counting.
- Use xcode or xcode4 for problems with the Xcode IDE.
- Use cocoa-touch or cocoa for problems with these collections of Objective-C APIs.