gpt4 book ai didi

objective-c - iOS 设置 UILabel 值

转载 作者:搜寻专家 更新时间:2023-10-30 20:09:16 24 4
gpt4 key购买 nike

我想在 self.myLabel.text 的末尾添加“已完成”一词,紧跟从 numberValue 返回的值。

所以,假设 numberValue 返回 234,我希望 self.myLabel.text 变为“234 已完成”。

我确信这是一项简单的任务,但我错过了显而易见的事情吗?!

仅用于显示数字的代码是:-

self.myLabel.text = [NSString stringWithFormat:@"%ld", numberValue];

最佳答案

self.myLabel.text = [NSString stringWithFormat:@"%d completed", numberValue];

关于objective-c - iOS 设置 UILabel 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20621677/

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