xcode_2

Screen Shot 2556-07-08 at 11.54.26 AM

//  ViewController.h
//  myapp22
//  Created by Guest User on 7/8/56 BE.
//  Copyright (c) 2556 Petcharaporn. All rights reserved.
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
- (IBAction)mybotton:(id)sender;
@property (weak, nonatomic) IBOutlet UILabel *mylabel;
@property (weak, nonatomic) IBOutlet UITextField *mytext;
@property (copy,nonatomic)NSString *myName;
@end

-------------------------------------------------------------------------------------

//  ViewController.m
//  myapp22
//  Created by Guest User on 7/8/56 BE.
//  Copyright (c) 2556 Petcharaporn. All rights reserved.
#import "ViewController.h"
@interface ViewController ()
@end

@implementation ViewController
@synthesize mytext;
@synthesize mylabel;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)mybotton:(id)sender {
NSString * ss=@"Hello ";
ss=[ss stringByAppendingString:mytext.text];
mylabel.text=ss;
}
@end

--------------------------result----------------------------------------

Command Q  ..stop running

Anytime you type in text box it will append next to Hello that we write code in "NSString * ss=@"Hello ";"

Screen Shot 2556-07-08 at 11.52.39 AM