I know the instance variable in ARC are by default __strong
. How can I release an instance variable when the containing class is still retained. In the following example v
is __strong
and c
is allocated when object of A is created some where and retained. I want to release the
c
instance variable. How to should I do that?, What should be in releaseC
method that will release the c
instance variable.
@interface A {
Obj *c;
}
@implementation A {
- (id)init {
if((self = [super init])){
c = [[Obj alloc] init];
}
return self;
}
- (void)releaseC {
//what should be here?
}
}