i wonder if the way i programm is right way or not. can you help me?
@interface ViewController : UIViewController
{
UILabel *messageLabel;
}
@end
when i declare new object in .h and create in .m i have to use @property (nonatomic, retain) UILabel *messageLabel? i saw few listings where when object are created by code @property doesn’t exist and few where does exist and i’m confused.
is it correct when i don’t use @property (in example for UILabel, UIImageView, UIButton) when i create objects by code?
@propertyis a key word useful to create setter/getter methods automatically for that field. If you don’t need to access your label from outside your view controller you won’t need to use@propertyand your code is fine.