我有一些 UILabel 和按钮。这是我的代码:
if ([label.text isEqualToString:@"The three blue dots represents GPS towers. Click Go to advance"])
{
firstClick = [[UIAlertView alloc] initWithTitle:@"Welcome!"
message:@"Blah, blah blah"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[firstClick show];
distanceLabel.text = @"Distance to first tower: 50 km";
a = YES;
}
if (a)
{
label.text = @"Now you know that the distance to the first tower is 50 km. Click Go to advance";
}
所有这些都在按钮的操作方法中。当按下按钮时,alertview 视图和 distanceLabel 更改其文本。然后单击警报上的 OK 按钮我想更改 label.text。我尝试过使用实例布尔值,但这不起作用。为什么那行不通,我该怎么办?