如何使两个输入显示为一个输出?

时间:2012-10-06 17:52:19

标签: objective-c

我有这两个输入

// @property (strong, nonatomic) IBOutlet UILabel *userOutput;
@property (strong, nonatomic) IBOutlet UITextField *userInput;
@property (strong, nonatomic) IBOutlet UITextField *userSecondInput;

我希望发件人将两个输入组合在输出上作为单行显示

- (IBAction)setOutput:(id)sender {
    self.userOutput.text=self.userInput.text;
}

1 个答案:

答案 0 :(得分:1)

尝试

self.userOutput.text = [self.userInput.text stringByAppendingString:self.userSecondInput.text];