For example one, I declare an object inside the interface brace {} like:
@interface testViewController : UIViewController {
IBOutlet UILabel * myLabel;
}
@property (retain, nonatomic) UILabel *myLabel;
@end
and example two, I declare an object outside the inferface brace {} like:
@interface testViewController : UIViewController {
}
@property (retain, nonatomic) IBOutlet UILabel *myLabel;
@end
I run the code and the result is the same, so I want to ask what is the different for decalare an object inside or outside the interface brace {}?
Thanks
The modern Objective-C runtimes (64-bit Mac OS X and iOS) will generate the backing store for your declared properties when you
@synthesizethem. So you don’t need to declare them within the braces.If you are declaring an iVar that is not a property and will only be used by the class, then they need to be declared. It’s a good idea to mark these
@privatee.g