a)在我的应用程序中扩展框架的类
b)创建框架类的子类并定义我需要的新属性
提前致谢
b)
因为不支持在类扩展中添加(存储)属性.
使用扩展有两个重要规则:
Extensions can add new functionality to a type,but they cannot override existing functionality Extensions can add new computed properties,but they cannot add stored properties,or add property observers to existing properties
Extensions can add new functionality to a type,but they cannot override existing functionality
Extensions can add new computed properties,but they cannot add stored properties,or add property observers to existing properties