Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #import <objc/runtime.h>
  2.  
  3. @implementation AVPlayerItem(oscahie)
  4.  
  5. + (void)load
  6. {
  7. Method origMethod = class_getInstanceMethod([self class], NSSelectorFromString(@"dealloc"));
  8. Method patchMethod = class_getInstanceMethod([self class], @selector(swizzledDealloc));
  9.  
  10. method_exchangeImplementations(origMethod, patchMethod);
  11. }
  12.  
  13. - (void)swizzledDealloc
  14. {
  15. NSLog(@"deallocating object <%@: %p>", [self class], self);
  16.  
  17. [self swizzledDealloc];
  18. }
  19.  
  20. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement