Search code examples
objective-ccocoa-touchself

When to use self. prefix when setting variables?


I am working on ARC based project . My outlets are declared using
unsafe_unretained property . Whenever I am using these outlets I use self.outletname
everywhere in my code.But I have heard people saying , use of self will increase the retain
count and we should use it only for strong properties. I am really confused. Shouldn't we use self for weak properties ?


Solution

  • self.propertyName = newValue will only increase retain count of newValue if it's a retained property.