In some books, Apple's code samples and internet resources I noted direct accessing to ivar instead of using synthesized accessors. It seems to me that it's very often for UILabel, UITextFiled and UITextView.
@interface MagicViewController : UIViewController {
UITextField *aField;
}
@property (nonatomic, retain) UITextField *field;
@implementation MagicViewController
@synthesize aField;
- (void) superMethod
{
aField.text = @"Bla-bla-bla";
NSString *string = [NSString stringWithString:aField.text];
NSLog(@"Ho-ho-ho %@", string);
}
The question: Is it safe for some reasons? Why they don't use
- (void) superMethod
{
self.aField.text = @"Bla-bla-bla";
NSString *string = [NSString stringWithString:self.aField.text];
NSLog(@"Ho-ho-ho %@", string);
}