我收到下面的代码错误.. 我把头撞在墙上,因为我不知道为什么我似乎无法用每次按下按钮的次数(计数器)更新消息按下按钮...
- (IBAction)countButtonTapped:(id)sender {
self.pressCount+=1;
//int count = (int)self.pressCount;
//[self.tapCountButton setTitle:@"I've been tapped %i time(s)!" forState:UIControlStateNormal];
//[self.tapCountButton setTitle:@"I've hit the main button!" forState:UIControlStateNormal];
//NSLog(@"I've been tapped %lu time(s)!", (unsigned long)self.pressCount);
[(UIButton *)sender setTitle:@"I've been tapped %@ time(s)!",self.pressCount forState:UIControlStateNormal];