我正在阅读这份文档来学习 Objective-C: https ://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html#//apple_ref/doc/uid/TP40011210- CH6-SW1
我的主题“使用类扩展隐藏私人信息”(pdf第73页)它说:
Class extensions are often used to extend the public interface with additional private methods or properties for use within the implementation of the class itself. It’s common, for example, to define a property as readonly in the interface, but as readwrite in a class extension declared above the implementation, in order that the internal methods of the class can change the property value directly.
我在这个声明中不明白的是,由于我们可以在类扩展中定义的任何私有方法中更改只读属性,而无需在类扩展中将该属性重新声明为读写,那么通过将该属性重新声明为读写?