【iOS中四种实例变量的范围类型@private@protected@public@package】教程文章相关的互联网学习教程文章

iOS中四种实例变量的范围类型@private@protected@public@package

文档上记录是这样的The Scope of Instance VariablesTo enforce the ability of an object to hide its data, the compiler limits the scope of instance variables—that is, limits their visibility within the program. 为了强制一个对象隐藏其数据,编译器限制实例变量范围以限制其在程序中的可见性But to provide flexibility, it also lets you explicitly set the scope at four levels. Each level is marked by a compi...