objective c - Call a super block / extending a block -
I have subclassed a class, which holds the block property, I need an extension.
Property of Superclass:
@ Property (nontomic, copy) ID (^ IEMM), (ID Dissociated ResponseBox);
Each time this block is set I need to expand the block by my code / block.
In fact, I want to do this in my subclass:
[Self SetldamDisrealized Responseball: ^ ID deserializedResponseBody {// Original block / / your own content Degradation of deserializedResponseBody; }];
How do I apply something like this? I got a similar question but due to the value of the blocks, I did not get any help from this?
No, you can not add code to an existing block, but you can not add the code Easily optimize the solution:
- (zero) setWillMapDeserializedResponseBlock: (id (^) (id)) IMapDeserializedResponseBlock {ID (^ Additional Code) (ID, ID) = ID ( Id deserializedResponseBody, id original ReturnVal) {// Whatever your own luggage return; }; Id (^ newWillMapBlock) (ID) = ^ id (id deserializedResponseBody) {id retVal = isMapDeserializedResponseBlock (deserializedResponseBody); Return additional code (deserializedResponseBody, retVal); }; _willMapDeserializedResponseBlock = newWillMapBlock; }
Comments
Post a Comment