You only need to synthesize when you access the variable directly.
I always access via properties unless I'm within a setter for that property or if I want to bypass my own lazy loading getter code. So I'm left with only a few occasional @synthesize statements in most classes.
And in Xcode, run Edit > Refactor > Convert to Modern Objective-C Syntax. I don't think it helps remove unnecessary @synthesize, but it sure helps with those super-double-extra-verbose-old-style container subscripting accesses.
Comments
Read http://developer.apple.com/library/ios/#releasenotes/Objecti... and on a related note, read http://clang.llvm.org/docs/ObjectiveCLiterals.html too.
You only need to synthesize when you access the variable directly.
I always access via properties unless I'm within a setter for that property or if I want to bypass my own lazy loading getter code. So I'm left with only a few occasional @synthesize statements in most classes.
And in Xcode, run Edit > Refactor > Convert to Modern Objective-C Syntax. I don't think it helps remove unnecessary @synthesize, but it sure helps with those super-double-extra-verbose-old-style container subscripting accesses.
The only place I need @synthesize is in NSManagedObject subclasses.
Ah. I stand corrected. I @synthesize because I always want foo and not _foo.