I am new in C/C++/coding.
I recently ran my first app code from the Xcode tutorial about "hello world"
I tried to take it further, by adding one more text field and renaming all other fields.
What I am trying to do is:
There are two textfields (first name and last name), Label is there as before and button is there as before.
Now when I click on the button, the label should display "firstname lastname"
However I don't know how to catch text from two textfield and display it in the label field.
I can display one field. But not both.
Here is the piece of code:
- (IBAction)B_showname: (id)sender
self.B_result = self.TF_firstname.text;
self.LB_clickthebutton.text = self.B_result;
The header file is:
HelloWorld_v1ViewController : UIViewController
(weak, nonatomic) IBOutlet UITextField *TF_firstname;
(weak, nonatomic) IBOutlet UITextField *TF_lastname;
(weak, nonatomic) IBOutlet UILabel *LB_clickthebutton;
(copy, nonatomic) NSStream *B_result;
- (IBAction)B_showname: (id)sender;
I would appreciate the help.
Thanks a lot in advance