我是 Objective C 的新手,我想我不明白你是如何处理对象的。我创建了一个 UILabel,我可以设置文本和其他所有内容。但我想用不同的方法更新它……意思是我想改变文本,但我没有那个方法中的对象!
这就是我设置 UILabel 的方式
- (void)viewDidLoad
{
    [super viewDidLoad];
    UILabel *scoreLabel = [ [UILabel alloc ] initWithFrame:CGRectMake((self.view.bounds.size.width / 2), 0.0, 150.0, 43.0) ];
    scoreLabel.textAlignment =  UITextAlignmentCenter;
    scoreLabel.textColor = [UIColor whiteColor];
    scoreLabel.backgroundColor = [UIColor redColor];
    scoreLabel.font = [UIFont fontWithName:@"Arial Rounded MT Bold" size:(36.0)];
    [self.view addSubview:scoreLabel];
    scoreLabel.text = [NSString stringWithFormat: @"%d", 0];
}
那就是我想更改 UILabel 文本的地方
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    self.crossView.alpha = 0.5;
    ...change scoreLabel.test 
}
这两种方法都在 ViewController 中!
也许我可以将 UILabel 绑定到自己?但如何?