PDA

View Full Version : monitoring int




schenker
Jul 26, 2011, 09:49 PM
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.



jnoxx
Jul 27, 2011, 03:12 AM
if (statement {
intName++;
someLabel.text = [NSString stringWithFormat:@"%i", intName];
}

I think you can even do someLabel.text = intName;

schenker
Jul 27, 2011, 05:01 AM
Hi, Is it inappropriate to use delegate in this case? Thanks.

if (statement {
intName++;
someLabel.text = [NSString stringWithFormat:@"%i", intName];
}

I think you can even do someLabel.text = intName;

jnoxx
Jul 27, 2011, 05:42 AM
Why would you start using delegates, if you barely know how to set text's to labels? :) just wondering..

schenker
Jul 27, 2011, 06:55 AM
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.

Why would you start using delegates, if you barely know how to set text's to labels? :) just wondering..