Are there 2 methods for declaring instance variables in Objective C?
In most tutorials, the way to declare an instance variable is to put it in .h
@interface myViewController: UIViewController {
UITextField *myTextField;
}
@property (nonatomic, retain) IBOutlet UITextField *myTextField;
and in .m
@implementation myViewController @synthetize myTextField;
But in this standford University course http://itunes.apple.com/itunes-u/ipad-iphone-application-development/id480479762 the way to do it rather
Only in .h:
@interface myViewController: UIViewController
@property (nonatomic, retain) IBOutlet UITextField *myTextField;
In .m we do this:
@synthetize myTextField = _myTextField;
Are they equivalent? Is the second method iOS5 specific?
0
source to share