我试图让标签将一位数显示为两位数(即 1 => 01)。我可能使用了错误的方法来设置标签的值,但问题是在翻阅了 Apple 的文档并搜索了互联网之后,我什至不确定这一点。
[secondsLabel setValue:[NSString stringWithFormat:@"%2d", seconds]]
我看到其他人将 stringWithFormat 用作 stringWithFormat:@"%.2f" 所以我想我会尝试类似的东西并将其更改为 "%2d",但不走运。感谢您提前提供帮助。