DHCOnDealloc 0.1.0

DHCOnDealloc 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.


Downloads

Total6
Week0
Month0

Installs

Apps2
powered by Segment

  • By
  • Daniel Haight

A simple category that allows you set a block to fire when an object is dealloced.

Instalation

Manual

copy contents of DHCOnDealloc to your project

Usage

to setup a block to execute before an object Foo is deallocated:

#import "NSObject+DHCOnDealloc.h"  

...

Foo *myFoo=[[Foo alloc] init];
[myFoo onDealloc:^{
  NSLog(@"I'll miss you bro");
  //and other more useful stuff
  //be careful of retain cycles
  //(google them)
}];
  myFoo=nil; //ARC will call -dealloc //this will fire your block //he will miss you bro