Reputation: 26223
Can I just check what is happening when you do the following (See below), I am right in thinking that no iVars are created in "INTERFACE" just three properties. In the "IMPLEMENTATION" those three properties are assigned to iVars called _window
, _animationTimer
& _currentFrame
which are created by the @synthesize
command?
// 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;
...
Upvotes: 1
Views: 116
Reputation: 237010
Yep, that's how it works. @synthesize
can now automatically generate the appropriate instance variables as well as accessors for them. It's a relatively recent development in the language.
Upvotes: 4