Wednesday, 11 September 2013

iOS ARC: When and which memory stays alive

iOS ARC: When and which memory stays alive

Say I have a custom NSObject class called customClass with a property
NSMutableArray *thisArray;
I instantiate customClass *instance = [[customClass alloc] init] in my
root view controller. Somewhere in the the customClass implementation
thisArray is set.
Now I have a property in my root view controller NSMutableArray
(strong,nonatomic) *anotherArray and I set it via anotherArray =
customClass.thisArray. If I then set customClass to nil, will anotherArray
still point to an object in memory or is / should it be destroyed? What
about the rest of the object and its properties memory?

No comments:

Post a Comment