gpt4 book ai didi

ios - 设置最大数量级?

转载 作者:行者123 更新时间:2023-11-28 22:26:16 25 4
gpt4 key购买 nike

我从事这个项目有一段时间了:

https://developer.apple.com/library/ios/samplecode/teslameter/Introduction/Intro.html

我正在尝试弄清楚如何使最高数字达到 100。因此,如果它达到 101,它将显示为 100,我将如何去做?我已经尝试过诸如

if (magnitudeLabel.text >= [NSString stringWithFormat:@"%.0f", 99])
{
setText:[NSString stringWithFormat:@"%.0f",100];
}

但没有任何效果,它超过了 100。

最佳答案

if ([magnitudeLabel.text intValue] > 100) {
[magnitudeLabel setText:@"100"];
}

看起来很公平,对吧?

关于ios - 设置最大数量级?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18876384/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com