在Xcode中,我想在每次点击UIButton时更新它的标题。让它显示1第一次击中,2第二次击中。你明白了

在Xcode中,我想在每次点击UIButton时更新它的标题。让它显示1第一次击中,2第二次击中。你明白了,xcode,Xcode,我想在每次使用变量点击UIButton时更新它的标题。看起来这可能涵盖了您所追求的内容 另一个标签将是您的UIButton的名称 static int count; count++; NSString *countString = [NSString stringWithFormat:@"%d", count]; [anotherLabel setText: countString]; 首先尝试谷歌搜索,或者至少自己尝试一下,如果遇到问题,你会问这个问题。:)

我想在每次使用变量点击UIButton时更新它的标题。

看起来这可能涵盖了您所追求的内容

另一个标签将是您的UIButton的名称

static int count;
count++;
NSString *countString = [NSString stringWithFormat:@"%d", count];
[anotherLabel setText: countString];

首先尝试谷歌搜索,或者至少自己尝试一下,如果遇到问题,你会问这个问题。:)