IDE: XCode Version 12.4 (12D4e)
- 新建App

- 给项目命名为HelloWorld,Interface选择Storyboard,Language选择Objective-C。

- 打开文件Main.storyboard,添加一个Label和Button组件。 

- 打开两个面板,一个显示Main.storyboard,另一个显示ViewController.h 

- 为Label新建 - New Referencing Outlet(右键点击Label,点击- New Referencing Outlet后的点不松开,拖到- ViewController.h中。将新的- Referencing Outlet命名为- helloLabel。 
- 为Button添加 - Touch Up Inside事件,将事件命名为- showHelloWorld。 
 这时,- ViewController.h的代码变为:- 1 
 2
 3
 4
 5
 6
 7
 8
 9
 10- // ViewController.h 
 #import <UIKit/UIKit.h>
 @interface ViewController : UIViewController
 @property (weak, nonatomic) IBOutlet UILabel *helloLabel;
 - (IBAction)showHelloWorld:(id)sender;
 @end- 同时, - ViewController.m中也自动添加了- - (IBAction)showHelloWorld(id)sender {}函数,在其中添加- _helloLabel.text = @"Hello World";
至此,最简单的IOS App开发完成。