4 ms·
> Obj-C is only dynamically typed > swizzling happens only once at compile time. Objective-C is a dynamic language in every sense of the term. As examples, a
by nspragmatic 14y ago
> Obj-C is only dynamically typed
> swizzling happens only once at compile time.
Objective-C is a dynamic language in every sense of the term.
As examples, at runtime, you can:
- change an existing class' superclass
- swizzle methods
- create a class ex nihilo (though it'd be a better idea to inherit from NSObject)
- give that class (or even an existing one) methods, ivars, and properties
.. and much more
Visit the runtime reference[1] and jump into a running Objective-C app with GDB or F-Script. It's a lot of fun.
[1] https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html https://developer.apple.com/library/mac/#documentation/Cocoa...