objective c - What are the differences between these two statements? -
#import "viewcontroller.h" @interface viewcontroller () { nsstring *string; } @end @implementation viewcontroller{ nsstring *string; } - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. }
what differences between these 2 statements? better?
assuming statements referring 2 different declarations of private instance variable string
, there no difference. 2 different ways of declaring private ivar. it's matter of preference. pick one.
i use 1 in @implementation
block. use class extension private properties , declaring conformance protocols.
Comments
Post a Comment