Remarks
以鍵盤輸入,而將結果顯示。UI Design
Label x1 for 輸出
TextField x 1 for 輸入
Button x1 for 事件觸發
Run Result
第一個 iOS 應用程式
Review
這程式相當簡單,與先前的工具相比較,Xcode 4.6.3 以上的版本已簡化瑣碎的記憶體管理,讓設計者更專注在必要的設計上。Great Tool!
Source Code
//
// EMViewController.h
// HelloNoun
//
// Created by Mac on 13/9/19.
// Copyright (c) 2013年 Mac. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface EMViewController : UIViewController
@property (strong, nonatomic) IBOutlet UITextField *inputLabel;
@property (strong, nonatomic) IBOutlet UILabel *outputLabel;
- (IBAction)setLabel:(id)sender;
@end
//
// EMViewController.m
// HelloNoun
//
// Created by Mac on 13/9/19.
// Copyright (c) 2013年 Mac. All rights reserved.
//
#import "EMViewController.h"
@interface EMViewController ()
@end
@implementation EMViewController
- (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)setLabel:(id)sender {
self.outputLabel.text = self.inputLabel.text;
}
@end
/end
沒有留言:
張貼留言