monitoring int

Discussion in 'iOS Programming' started by schenker, Jul 26, 2011.

  1. macrumors newbie

    Joined:
    Jul 14, 2011
    #1
    Hi, I have an int counter that will get incremented if certain criteria meets. When this counter increments, i want its value to be updated on a uilabel. What is the best way to achieve this? Thanks.
     
  2. macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    Code:
    if (statement {
        intName++;
        someLabel.text = [NSString stringWithFormat:@"%i", intName];
    }
    I think you can even do someLabel.text = intName;
     
  3. thread starter macrumors newbie

    Joined:
    Jul 14, 2011
    #3
    Hi, Is it inappropriate to use delegate in this case? Thanks.

     
  4. macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #4
    Why would you start using delegates, if you barely know how to set text's to labels? :) just wondering..
     
  5. thread starter macrumors newbie

    Joined:
    Jul 14, 2011
    #5
    I've near completed my app, but without really exploring delegates much until recently. So, im looking thru my codes to see how i can use delegates to make things work better.

    I was just wondering if it would be appropriate to use delegates for the score counter.

     

Share This Page