如何从文本字段获取信息?

时间:2013-02-08 22:51:07

标签: label textfield

我是xcode的新手。我有一个文本字段表单,在这种形式我只能键入数字。 我如何从这个文本字段中获取信息到我的标签?

2 个答案:

答案 0 :(得分:0)

我猜你正在为iOS开发? [label setText:textField.text];应该这样做。

答案 1 :(得分:0)

@implementation WorktimerViewController{
NSTimer *timer;
int MainInt;
int zarabotal;
int stavka; }

@synthesize price;
@synthesize donebutton;
@synthesize lave;




- (void)updateLabels
{
self.lave.text = [NSString stringWithFormat:@"%d", zarabotal];

}
- (void) countup
{
MainInt += 1;
_second.text = [NSString stringWithFormat:@"%i", MainInt];


}

- (void)StartTimer{
MainInt = 1;
timer = [ NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(countup) userInfo:nil repeats:YES];
 zarabotal = stavka / MainInt;
[self updateLabels];

}