开发者

How do you reset real number count?

This is simple code for add number. I press 10 times.

- (IBAction)Button1 {

NSString *numValue = [[NSString alloc] initWithFormat:@"%d", count++];
counter.text = numValue;
[numValue release];
{

I clicked Reset button and start pressin开发者_C百科g Button1. What happen to Zero?

- (IBAction)Reset {
Counter.text = nil;
}

How do I reset back to real value zero?


How about:

- (IBAction)Reset {
   count = 0;
   counter.text = @"0";
}


-(IBAction) resetNum

{

//actual variable
count = 0;

//just for cosmetics
Counter.text = @"0";

}


-(IBAction) Reset 

{

count = 0;

Counter.text = @"0";

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜