Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tvinshan

macrumors newbie
Original poster
Aug 28, 2013
4
0
Im new to programming, bear with me :)

What is the reason to make a label? Watched some tutorials where they made such thing, but didn't explain for what purpose. Isn't it the same as adding a button and have it do it an action when pressed?
 
I can't see any reason why the string in a label can't be dynamic.
So it could be a game score, etc. that changes all the time.
The label is an object containing a string among other things like the window size,
and position on the screen.

It's not user interactive, but your app should be able to change it.
I really should learn this iOS stuff one day.
 
I can't see any reason why the string in a label can't be dynamic.
So it could be a game score, etc. that changes all the time.
The label is an object containing a string among other things like the window size,
and position on the screen.

It's not user interactive, but your app should be able to change it.
I really should learn this iOS stuff one day.

I didn't say it had to be static, I just said the user doesn't edit the text. Maybe I should have said directly doesn't edit the text.

I agree with the point you're making, I just wanted to give a typical/ basic example of a label as the user seems quite new to the sdk.
 
I can't see any reason why the string in a label can't be dynamic.
So it could be a game score, etc. that changes all the time.
The label is an object containing a string among other things like the window size,
and position on the screen.

It's not user interactive, but your app should be able to change it.
I really should learn this iOS stuff one day.

You're completely correct there.

You can update / change the labels text based on events that happen in the game For example a game score, card counts, that sort of thing.

You access the label though an IBOutlet and just use an NSString property. Very simple.
 
I didn't say it had to be static, I just said the user doesn't edit the text. Maybe I should have said directly doesn't edit the text.

I agree with the point you're making, I just wanted to give a typical/ basic example of a label as the user seems quite new to the sdk.

I didn't say what you did or did not say. It's totally cool.
I hardly remember whether or not I've used one :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.