9.6. Brief introduction

发布时间 : 2025-10-25 13:32:30 UTC      

Page Views: 10 views

In iOS, action and Outlet refer to ibActions and ibOutlets, where the ib interface generator is located. All of these are related to the UI element, and we will learn about them visually and explore how to implement them. Step =

Let’s use the first iPhone application.

2、从导航部分中的文件中选择ViewController.xib文件

3、从右手边得窗口下面显示的窗口格库中选择UI元素

objectLibrary

4、拖拽UI元素到界面生成器的可视框中

5、添加标签和红色圆形按钮到可视图中

interfaceAction

6、在工作区工具栏的右上角找到编辑器选择按钮,如下图所示

StandardEditor

选择编辑器按钮

AssistantEditor

7、编辑器区域中心有两个窗口,ViewController.xib文件和ViewController.h

8、右击标签上的选择按钮,按住并拖动新引用参照,如下所示

ibOutletDrag

9、现在放在ViewController.h之间的大括号中。也可以放在文件中,如果是这样,必须在做这个之前已经添加了。如下所示

ibOutletDrop

10. 输入输出口(Outlet)的标签名称,这里给出的是myTitleLable。单击链接,完成ibOutlet

Similarly, to add an operation, simply right-click the rounded rectangle and choose to touch the heart and drag the curly braces below it

ActionDrag

12、重新命名为setTitleLable

ActionDrop

13、 选择ViewController.m文件,有一种方法,如下所示

-(IBAction) setTitleLabel:(id)sender{ } 

14、在上述的方法内,如下所示,添加一个语句

[myTitleLabel setTitleText:@"Hello"]; 

15、选择运行按钮运行该程序,得到如下的输出

IBActionTutorial.Simulator_Start

16、单击按钮

IBActionTutorial.Simulator_end

17.、创建的参照(outlets)按钮标签已更改为对按钮执行的操作(actions)

As you can see from the above, IBOutlet will create a reference to UIElement (in this case, UILable), and the same IBAction and UIButton will be linked to UIButton by performing actions.

When creating an action, you can do different actions by selecting different events.

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。