I'm new to objective c and I've got an interesting situation where I need two different NSDictionary objects that point to the same values. In that situation should I use strong or weak in the property declaration? Or should I do strong in one and weak in the other?
In Game.m
@property (strong/weak, nonatomic) NSDictionary* answers1;
In User.m
@property(strong/weak, nonatomic) NSDictionary* answers2;
In both cases the key will be an integer, but the value will be an answer object of my own making. Both answers1 and answers2 will need to exists for roughly the same amount of time. When it comes time to get rid of one it'll be okay to get rid of the other.
Both should probably be strong
. Each class should do its own memory management without having to worry about what other classes are doing. Therefore, each should keep its own strong
reference.