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 ))block
Parameters
- 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.h
swizzleClassMethod: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)otherSelector
Parameters
- selector
The first method
- otherSelector
The second method
Declared In
NSObject+DTRuntime.h
swizzleMethod: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)otherSelector
Parameters
- selector
The first method
- otherSelector
The second method
Declared In
NSObject+DTRuntime.h