I am new to objective c,so plz me help with this... i have used three textfields in the interface builder textfield1 inputs the first number textfield2 inputs the second number
and i have created a button called sum which will calculate the sum and textfield(ans) will display the result
.h 档案编码
{
IBOutlet UITextfield txtfield1;
IBOutlet UITextfield txtfield2;
IBOutlet UITextfield ans;
}
-(IBAction)add;
m 文档代码
-(IBAction)add
{
int result=[txtfield1.text intValue]+[txtfield2.text intValue];
ans.text=[NSString StringWithFormat:@"%d",result];
}
该方案实行罚款,但只想在文字领域输入立体值,如果是进入字母顺序,点击总吨数,即像 an子一样,那么用户在投入字母顺序时会发现错误。