我正在尝试将字符"1"添加到Xcode Objective-C中文本框"output"的现有值中。
我正在尝试使用"stringByAppendingString"函数,并查看了一些示例,但似乎无法使其正常工作。
我的语法是否有误?
- (IBAction)pressOne:(id)sender {
NSString *str1 = output.text;
output.text = [str1 stringByAppendingString:[@"1"];
}
我正在尝试将字符"1"添加到Xcode Objective-C中文本框"output"的现有值中。
我正在尝试使用"stringByAppendingString"函数,并查看了一些示例,但似乎无法使其正常工作。
我的语法是否有误?
- (IBAction)pressOne:(id)sender {
NSString *str1 = output.text;
output.text = [str1 stringByAppendingString:[@"1"];
}