作者firemonny (焱神)
看板MacDev
标题[问题] ios计次器显示不出来
时间Sat Dec 28 13:03:15 2013
我写了一按钮 每按一次
label 就会加一
但是我写在 .m
code 如下
@implementation RTViewController
@synthesize rr, displaytime;
int rrtime; // declare count number <--变数宣告在这里
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
int rrtime;
- (IBAction)startpause:(UIButton *)sender{;
}
- (IBAction)rrcouner:(UIButton *)sender{
rrtime++; // while push the bottom rrtime plus 1 <--按下以後加一
rr.text=@"%d",rrtime; //display the value <--输出
}
- (IBAction)enterdata:(UIButton *)sender{;}
}
下面省略
但是我用模拟器跑出来
他一直都是显示 "%d"
没有run-time error 但是跳出 expression result unused的警告讯息
请问我该怎们办T_T
小弟初学者
只有基础C++的知识
谢谢解答
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 23.17.129.33
1F:→ yuanruo:[NSString stringWithFormat:@"%d",rrtime] 12/28 13:07
2F:→ firemonny:噢喔噢 感谢大大解答!!! 12/28 13:31
3F:→ darktt:不要吧C++的概念用在Objective-C上 12/28 16:03
4F:→ uranusjr:C++ 也不是这样写的吧XD 12/29 20:34