gpt4 book ai didi

objective-c - 我该怎么做 : label. text = ( @"some string"+ _label2.text);

转载 作者:行者123 更新时间:2023-12-04 02:40:33 25 4
gpt4 key购买 nike

我是 Objective-C 的新手,虽然我有一些 java 和 C# 的经验,但我就是无法让它工作。

我的代码是:

- (IBAction)btnClickMe_Clicked:(id)sender {
Label_1.text = (@"some string" + _Label_2.text);
}

我也很好奇为什么 Label_1 不需要像 _Label_2 那样在其前面加下划线?

最佳答案

要连接字符串,您可以使用

Label_1.text = [@"Some string" stringByAppendingString:_Label_2.text];

关于objective-c - 我该怎么做 : label. text = ( @"some string"+ _label2.text);,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17299029/

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