Do you use:
UIView *view;
Or
UIView* view;
Or
UIView*view;
While there is not right or wrong as all of them are correct from compiler point of view, the preferable syntax becomes clear when we have multiple values, view1 and view2:
Each of the above will translate into
UIView *view1, *view2;
UIView* view1,* view2;
UIView*view1,*view2;
Obvious the winner is the first version.
The last two version have the potential issue of forgetting the *, making the code incorrect:
UIView* view1, view2;
UIView*view1, view2;
To conclude the proof, the winner is:
UIView *view;
How about the strong-typed array?
The suggested syntax is the following:
NSArray <NSString *> *array;
The proof is step by step.
NSArray <NSString *> *array;
Totally Agree!!
ReplyDelete