What is a label?

Discussion in 'iOS Programming' started by tvinshan, Aug 28, 2013.

  1. tvinshan macrumors newbie

    Joined:
    Aug 28, 2013
    #1
    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?
     
  2. thedon1 macrumors 6502

    Joined:
    Jun 26, 2010
    #2
  3. tvinshan thread starter macrumors newbie

    Joined:
    Aug 28, 2013
  4. xArtx macrumors 6502a

    Joined:
    Mar 30, 2012
    #4
    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.
     
  5. thedon1 macrumors 6502

    Joined:
    Jun 26, 2010
    #5
    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.
     
  6. Tander macrumors 6502a

    Tander

    Joined:
    Oct 21, 2011
    Location:
    Johannesburg, South Africa
    #6
    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.
     
  7. xArtx macrumors 6502a

    Joined:
    Mar 30, 2012
    #7
    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
     
  8. thedon1 macrumors 6502

    Joined:
    Jun 26, 2010
    #8
    Ok sorry then, I thought your first reply was aimed at me.
     

Share This Page