I am currently learning about ARC and noticed the following in some of the updated texts I've been reading.
I am used to seeing:
@interface myViewController: UIViewController
{
UIButton *myButton;
}
@property (nonatomic, retain) IBOutlet UIButton *myButton;
@end
@implementation myViewController
@synthesize myButton;
...
@end
I see the new format is:
@interface myViewController: UIViewController
@property (weak, nonatomic) IBOutlet UIButton *myButton;
@end
@implementation myViewController
@synthesize myButton;
...
@end
I am assuming that the section:
{
UIButton *myButton;
}Is recognized by simply typing:
@property (weak, nonatomic) IBOutlet UIButton *myButton;
Is this true? Also, is this technically due to ARC or is it that the compiler in Xcode 4.2 allows for the change?
Finally, I notice in the new addition of the book you add the following to the @implementation section:
{
int numerator;
int denominator;
}
However, this is not added to the example I used above and is not in the "Transition to ARC" guide. Is this because they are not objects or is there another reason they are added in the book.
Take care,
Jon