NSObject(DTRuntime) Category Reference
| Declared in | NSObject+DTRuntime.h |
Class Methods
addInstanceMethodWithSelectorName:block:
Adds a new instance method to a class. All instances of this class will have this method.
+ (BOOL)addInstanceMethodWithSelectorName:(NSString *)selectorName block:(void ( ^ ) ( id ))blockParameters
- selectorName
The name of the method.
- block
The block to execute for the instance method, a pointer to the instance is passed as the only parameter.
Return Value
YES if the operation was successful
Discussion
The block captures self in the calling context. To allow access to the instance from within the block it is passed as parameter to the block.
Declared In
NSObject+DTRuntime.hswizzleClassMethod:withMethod:
Exchanges two class method implementations. After the call methods to the first selector will now go to the second one and vice versa.
+ (void)swizzleClassMethod:(SEL)selector withMethod:(SEL)otherSelectorParameters
- selector
The first method
- otherSelector
The second method
Declared In
NSObject+DTRuntime.hswizzleMethod:withMethod:
Exchanges two method implementations. After the call methods to the first selector will now go to the second one and vice versa.
+ (void)swizzleMethod:(SEL)selector withMethod:(SEL)otherSelectorParameters
- selector
The first method
- otherSelector
The second method
Declared In
NSObject+DTRuntime.h