1. Always use properties for everything to be consistent, even non-public class scoped variables should be done as properties unless there is a good reason not to (this will help us later if we run into threading issues and have to do any locking).
  2. Always set and get via properties calls (I.e. self.property, not bare assignment or accessing ivars).
  3. EXCEPT in the init and dealloc methods. Apple recommends directly accessing ivars in these two cases to avoid side-effects. That may mean manual retains in the init methods in some cases (as opposed to property based e.g. nonatomic, retain declaration).
S. Petschulat
Advertisements