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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -