I've been perusing an open source project that uses a storyboard that contains a few view controllers. For some reason, the UI elements do not use @property IBOutlet
declarations in the .h file, but rather are ivar's (sometimes __weak
) declared in the .m file like so:
@implementation FunnyScreen {
__weak IBOutlet SillyButton *bouton;
}
instead of what I've always done and seen other people do:
@interface FunnyScreen: UIViewController
@property (nonatomic,strong) IBOutlet SillyButton *bouton;
Does anyone know why someone would write code like the first example i.e. ivar approach? Does it serve any purpose? I'm keeping an open mind.