Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective-C - Test for object instance being dealloced/freed

Tags:

There's some way to test for an objective-c instance for being dealloced/freed (retain count == 0)??

By example, object A have a reference (pointer) to object B, but object B can be freed in memory low levels, how i test reference B to be sure it was dealloced??

@interface A : NSObject {
    B b;
}

@implementation A {

- (void) someAction:(id) sender {
    //is b previously dealloced?? 
    if ..... ???? {
        b = [[B alloc] init];
    }
    // continue
}
}

Thanks!!


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!