I think there may be some confusion as to when the property's memory management options kicks in. They only affect the setter not the getter. Here's a quick review using ARC:
strong - The object is retained when setting the property. The previous value is released. This is what you want to use with objects most of the time as you usually want to have a retain on your ivars so they do no get deallocated Underneath, this looks something like this:
-(void)setObject:(id)obj
{
[obj retain];
[_object release];
_object = obj;
}
assign - Always used for non-object values such as C scalars or structs. As these are just values and not objects, no memory management is done. Underneath, this looks something like this:
-(void)setInteger:(NSInteger)newInt
{
_nteger = newInt;
}
copy - A new object of the same type is created and the contents of the object passed in are copied. This only works for objects that conform to the NSCopying protocol. You generally use this when you want to use the original values of an object and then edit the original object. (eg if you have an NSMutableString set to "Jane" and set a copied property using it, the property will still report "Jane" even after you change the originat NSMutableStringn to "John") Underneath, this looks something like this:
-(void)setObject:(id)obj
{
id copy = [obj copy];
[_object release];
_object = copy;
}
weak - This is very similar to assign, except when the assigned object is dealloced, the pointer reverts to nil. This is generally used in situations that would result in retain cycles otherwise. For example, a view controller setting itself as the delegate of a view that it owns. Weak is used to avoid both objects retaining each other and thus never being released.
When you write object.property = value;
, [object setProperty:value]; is actually being called behind the scenes.
I suspect that you want to use retain as you have listed. As far as I can tell, no weak properties come into play in the code snippets you have listed, unless _leftPanelViewController.repotLabels
is a weak property.