RufioLJ
RufioLJ

Reputation: 437

How make two inputs appear as one output?

I have these two inputs

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

I'd like the sender to combine both inputs to appear on the output as a single line

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

Upvotes: 1

Views: 77

Answers (1)

Yuliani Noriega
Yuliani Noriega

Reputation: 1083

try

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

Upvotes: 1

Related Questions