@
ultragtx 嗯,想了下这样确实不好.class类中如果要使用,还是推荐instance variable.
原文中有描述:
"NEVER allow your instance variable names to be confused with property names, or with data member names. ALWAYS end your instance variable names with an underscore. UNLESS you are subclassing a 3rd-party class which already has a data member of the same name, in which case pick another non-similar name or add another underscore and put a comment in as to why you did this.
Use “@synthesize name = name_;” in your implementation, instead of just “@synthesize name;”
WHY?
Even within the class implementation you have to have a very good reason to access a data member directly, instead preferring property accessors."