dhoerl/NSAttributedString-Additions-for-HTML — comment on commit 06980a2878342bb988a0c68da08b7fc6c897a67a
File:  line 0
By dhoerl18:

> What's the benefit of having the ivars in implemenation versus .h?

This fits in with the whole idea of information hiding. For example, Apple gave us "class extensions" so we could "hide" methods that are private to the class. Moving the ivars into the implementation has no runtime affect - it just reduces "clutter" in the interface, making it easier for users to see what they can use. Obviously if they want to probe they can. Also, you can add and delete ivars easier - you don't have to switch from file to file (this is not a big deal, but I've found it nice since I moved my ivars). This feature only became available with 4.2 (I believe). Ivars are private to the class and Apple's letting us put them in the implementation was long overdue.

Also, you don't need to declare ivars for properties anymore - you (or I) could remove those ivars backed by properties. I know there use to be reasons for the "_ivar" ivars (I forget now) - you can now just refer to them by the property name (i.e. with "property id foo;" you can just refer to "foo" now, no need for self.foo anymore;

I resisted the temptation to move the properties above all the method declarations in the implementation files - this is the canonical place to put them (i.e. Apple's standard style) :-)

If you have issues with anything I did I'll put it back. In addition to ARC, I ran "Analyze" on the code and fixed all errors, as well as addressed all warning when the source was included in my project (which has many more warnings on than you have).

David