我试图找到将浮点值放入UIAlertView
. 我的float
值仅用于检查另一个值,而不是传递给某处的字符串。
我想我可以将我的float
值设置为标签并将其设置为hidden
并将其传递给我的警报,但我确定这不是正确的方法,我们将不胜感激
float x = ([_continuityRingFinalR1.text floatValue]); /stringWithFormat:@"%.1f", x * y]]
float y = (1.67);
if ([_continuityRingFinalRn.text floatValue] > x * y ) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Advisory Warning"
message:[NSString stringWithFormat: @"Based on your value of %@ this value may not be acceptable. %@ would be acceptable",_continuityRingFinalR1.text, ]///<<< my float value here
delegate:self cancelButtonTitle: @"Ignore" otherButtonTitles: @"Retest", nil];
[alert show];
}