Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective-C Naming UILabel iOS [closed]

I have been wondering for quite a long time what to do with this.

Suppose I will be creating an UILabel, this label will contain a name. So without giving it much of thought, I will name this UILabel |name|.

Then I will have an NSString which will hold the actual string of the name. So I think naming the string |name| would be more appropriate right?

But what would I name the UILabel then?

I thought about naming it labelName.

But this is hungarian notation which is highly discouraged?

This is a dead end?

like image 351
WYS Avatar asked Dec 11 '22 15:12

WYS


1 Answers

Objective-C is a verbose language. It's common to include the type of variables and parameters when naming them.

UILabel *nameLabel = ...
NSString *name = ...

In case of primitive values (or even NSStrings and NSNumbers) usually the type is omitted.

like image 120
DrummerB Avatar answered Jan 12 '23 03:01

DrummerB