【发布时间】:2015-12-15 01:14:16
【问题描述】:
这里是代码。只要选择UIPickerview中的某些东西,我正在尝试使按钮做不同的事情。
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
switch(Striped Bass)
//Striped Bass
{
- (IBAction)calculateButtonPressed:(id)sender {
NSLog(@"Calculate Pressed");
float girth = [[self.girthTextField text] floatValue];
float length = [[self.lengthTextField text] floatValue];
NSLog(@"girth: %f length: %f", girth, length);
float weight = girth * girth * length / 800;
NSLog(@"Weight: %f", weight);
NSString *weightText = [NSString stringWithFormat:@"%f", weight];
self.weightTextField.text = weightText;
}
}
【问题讨论】:
-
如果我没记错的话,这段代码会给你一个解析错误。
-
@Ares 你能帮我解决这个错误吗
-
为什么不能更新你之前的问题?没有理由发布新问题。
标签: ios objective-c uibutton uipickerview