问题描述
|
我可以检查一下执行以下操作时会发生什么(请参见下文),我认为在\“ INTERFACE \”中仅创建三个属性不会创建iVar。在\“ IMPLEMENTATION \”中,将这三个属性分配给名为
_window
,_animationTimer
和_currentFrame
的iVar,它们是由?3ѭ命令创建的?
// INTERFACE
@interface testDelegate : NSObject ... {
}
@property (nonatomic,retain) IBOutlet UIWindow *window;
@property (nonatomic,assign) NSTimer *animationTimer;
@property (nonatomic,assign) int currentFrame;
...
。
// IMPLEMENTATION
@implementation testDelegate
@synthesize window = _window;
@synthesize animationTimer = _animationTimer;
@synthesize currentFrame = _currentFrame;
...
解决方法
是的,这就是它的工作原理。 ѭ3现在可以自动生成适当的实例变量及其访问器。这是该语言中相对较新的发展。