Objective-C对象初始化和新特性
?
一。对象初始化
两种创建对象的方法:a.[类名 new];b.[[类名 alloc] init];
这两种方法是等价的,不过通常的Cocoa惯例是使用b方法,而不是用a方法。
1.编写初始化方法
@property (readonly) float size;