The main difference between the two approaches is that you can include the class extension in a separate header, whereas the @implementation ivars obviously have to go with the @implementation block in the .m file (and there can only be one @implementation for a given class (extensions not included)). The practical result of this is that you can have multiple levels of "private" ivars:
- MyClass.h: public ivars
- MyClass+Private.h: semi-private ivars
- MyClass.m: really private ivars
As a hypothetical example, pretend that MyClass is UIView. In that case, UIView.h is the header that we can all access, UIView+Private.h is the "private" header than only Apple can access, and UIView.m has stuff that only the people specifically responsible for UIView need to know about.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…